matched_enums_macro 1.3.0

Contains the macro for matchable enums.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::Enumeration;
use quote::quote;
use syn::ItemEnum;

#[test]
fn try_from_helper_as_wrong_format() {
    assert!(Enumeration::try_from(
        syn::parse2::<ItemEnum>(quote! {
            #[derive(Matched)]
            enum Foo {
                #[matches = 0..1]
                Bar
            }
        })
        .unwrap()
    )
    .is_err());
}