A macro that generates an enum with the variants Yes
and No
.
use yes_or_no::yes_or_no;
yes_or_no!(Hungry);
assert_eq!(Hungry::from(true), Hungry::Yes);
assert_eq!(Hungry::from(false), Hungry::No);
assert!(Hungry::Yes.yes());
assert!(Hungry::No.no());