boolean-enums
Convenient macro to generate enums with Yes and No variants.
Supports no_std
.
Useful in cases of multiple bool arguments:
#[macro_use] extern crate boolean_enums;
gen_boolean_enum!(First);
gen_boolean_enum!(Second);
gen_boolean_enum!(Third);
fn do_smth(flag1: First, flag2: Second, flag3: Third) {
}
fn main() {
let first = First::Yes;
let second = Second::No;
let third = Third::Yes;
do_smth(first, second, third); do_smth(first, third, second); }