strum
strum copied to clipboard
Add `#[strum(transparent)]` attribute
Adds the transparent attribute, usable with AsRefStr, Display and IntoStaticStr. This delegates the derived trait impl to the underlying (single) field of the enum variant.
Implementing this for EnumString would be nice, but it doesn't really act the same way as for the other traits. For EnumString, something like #[strum(other)] (similar to #[serde(other)]) would make more sense, because there you would have a last single attempt to parse the input into a catch all variant, whereas trasparent can be added to multiple variants.
Therefore, if desired, that should be handled in a separate PR.
Closes #258