1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#![no_std]

/// Get all variants.
///
/// See also the IntoEnumIterator trait of the `strum` crate for a
/// version which can be automatically derived.
pub trait EnumIter
    where Self: Sized,
{
    fn variants() -> &'static [Self];
}

impl EnumIter for bool {
    fn variants() -> &'static [Self] {
        &[true, false]
    }
}