Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 617 Bytes

README.md

File metadata and controls

18 lines (13 loc) · 617 Bytes

yes-or-no

crates.io badge docs.rs badge CI Status

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());