JelteF / derive_more

Some more derive(Trait) options
MIT License
1.73k stars 123 forks source link

`AsVariant` for enum #358

Open TylerBloom opened 5 months ago

TylerBloom commented 5 months ago

It would be nice to have a derive macro that is similar to IsVariant and Unwrap but that turns an enum into an Option<T> (where T is the data of that variant).

JelteF commented 1 month ago

Makes a lot of sense. Feel free to contribute a PR.