extract-variant-0.1.0 has been yanked.
Variant: Destructuring Macro
This small crate exports a single macro variant!, which can be used to destructure an expression into, and return assignments from, a single pattern. It works similarly to the matches! macro from the rust std lib.
This macro is mainly useful for reducing matching boilerplate when you just want to try and extract some values from a pattern match (my reason for making this 😉).
Examples
use variant;
let val = Some;
let res = variant!.expect;
assert_eq!;
let res = variant!;
assert!;
There are more examples on the docs page