derive_more
derive_more copied to clipboard
Feature request: Derive Into for enums with repr
trafficstars
Deriving
Intofor enums is not supported as it would not always be successful, soTryIntoshould be used instead.
This is true for enums with payloads, but for enums without payloads and with an explicit repr, it would be very reasonable to derive value as u8 or whatever as the body of From<MyEnum> for u8. Not that it's too hard to write by hand, but…
(repr(C) should probably not be included; core::ffi::c_int is usually the right type for that but not always, and trying to decide what the right type is could be a problem.)