1. 20

  2. 3

    I think my favorite of those by a large margin is the first ‘tedious’ option. Possibly wrapped up in a function if it’s called everywhere.

    Its simple, clear what it does, readable, and not particularly verbose.

    And it’s less code than the suggested solution.

    1. 1

      As for derive(From), there’s actually quite a few options - see e.g. https://docs.rs/derive-from-ext or https://docs.rs/derive_more. For more fun with derive (though not specifically applicable to From), see also: https://lib.rs/crates/derivative.