derive_more
derive_more copied to clipboard
Add new derive: AsVariant
trafficstars
Resolves #358
Synopsis
A new derive for generating as_foo, as_bar methods for an enum with fields foo and bar.
Solution
Similar to TryUnwrap but generates functions returning an Option instead of a Result.
Checklist
- [x] Documentation is updated (if required)
- [x] Tests are added/updated (if required)
- [x] CHANGELOG entry is added (if required)