Create your own Option-like enum
Create your own enum type that behaves like Rust’s Option but with custom names.
Example
use option_like;
option_like!;
// Create instances
let c1 = Hit;
let c2 = Miss;
// Boolean tests
assert!;
assert!;
// Convert to Option
assert_eq!;
assert_eq!;
// Convert from Option
assert_eq!;
assert_eq!;
Installation
cargo add option-like
Gratitude
Like the project? ⭐ Star this repo on GitHub!
License
Apache-2.0 or MIT.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, shall be licensed as above, without any additional terms or conditions.