enum-helper 0.2.0

Yet another enum helper. Macros that generate common boilerplate for enums.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use assert2::check;

mod inner {
    use enum_helper::EnumStr;

    #[derive(EnumStr, PartialEq, Eq)]
    pub enum PubInner {
        Foo,
    }
}

#[test]
fn pub_outer() {
    let error = inner::InvalidPubInner::new("input");
    check!(error.to_string() == "invalid PubInner, expected one of \"Foo\"");
}