soccer
Associated constants for Rust enums
NOTE: Tests and documentation are very much still a work in progress for the time being
A Basic Example
soccer can generate code to make treating a fieldless enum as a discrete set of constants easier by deriving TryFrom, Into, and Display:
It can also use the discriminant to do this:
Those are both actual use cases I've encountered in my own Rust projects that motivated the creation of this crate.
(I used to maintain the https://github.com/a-lafrance/discrim crate for this discriminant-based conversion codegen, but since it got absorbed into soccer I've archived it and don't work on it anymore)