derive_more icon indicating copy to clipboard operation
derive_more copied to clipboard

Feature request: Derive Into for enums with repr

Open jrose-signal opened this issue 6 months ago • 1 comments
trafficstars

Deriving Into for enums is not supported as it would not always be successful, so TryInto should 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.)

jrose-signal avatar May 02 '25 19:05 jrose-signal