This crate provides VariantCount
derive macro for enum which adds to it the VARIANT_COUNT
constant, containing count of enum variants.
The VariantCount
usage example:
```rust
enum Test {
First(i32),
Second(Option
asserteq!(Test::VARIANTCOUNT, 3); ```
If you're using Cargo, just add it to your Cargo.toml:
toml
[dependencies]
variant_count = "*"
MIT