boolean-enums

Build Status Crates.io Documentation

Convenient macro to generate enums with Yes and No variants.

Useful in cases of multiple bool arguments: ```rust

[macrouse] extern crate booleanenums;

genbooleanenum!(First); genbooleanenum!(Second); genbooleanenum!(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); // compiles
do_smth(first, third, second); // fails

} ```