Lolirofle / enum_traits

Simple traits and derives for enums in the Rust programming language
MIT License
6 stars 5 forks source link

Derive "Option pattern" #6

Open CryZe opened 7 years ago

CryZe commented 7 years ago

I don't have a good name for this but a lot of enums have methods for each variant that return an Option<...> for that variant's data. Both Result and Option in the standard library do that for example. Could easily be derivable. Also there's fn is_<variant>(&self) -> bool for all of these variants too.