Various macros providing more beautiful syntax for enums.
Macro providing a more beautiful syntax for enums.
```Rust use altenum::altenum; alt_enum!(
test enum: first, second-variant, nyan nyan );
assert_eq!(format!("{:?}", TestEnum::SecondVariant), "SecondVariant"); ```
Macro providing a more beautiful syntax for enums with associated values.
(using value-enum crate, needs value_enum feature enabled)
```Rust use altenum::altval_enum;
altvalenum!(
some nya -> &'static str: first: "42", second-variant: "meow", nyan nyan: "nyaa~" );
assert_eq!(<&str>::from(SomeNya::NyanNyan), "nyaa~"); ```