Enumizer - Option/Result enums with named variants
crates.io·1d·
Discuss: r/rust
🦀Rust
Preview
Report Post

Hi, after a conversation at work, where we wanted an Option type but with clear meanings for what the None variant made, I quickly hacked up the Enumizer crate - a crate with macros that create Option/Result/Either equivalent types, with user-chosen variant names. The crate is still far from complete - I implemented the functions that I thought are must-have, but there's still plenty to do, if anyone wants to contribute :)

<edit> I'm seeing from the discussion below that this might not be as clear as I imagined it to be :)

Let's say that you have a mechanism that has an expensive lookup for values, but also has so...

Similar Posts

Loading similar posts...