quick-impl 0.2.1

Quickly implement usual methods and traits for enums and structs.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use quick_impl::quick_impl_all;

#[test]
fn test_enum_all() {
    #[quick_impl_all(pub const is, pub const as_ref)]
    #[allow(unused)]
    enum Test {
        First(usize),
        #[quick_impl(pub try_into)]
        Second(isize),
        Third(char, usize),
        Fourth(String),
    }

    assert!(Test::First(12).is_first());
    assert!(Test::Second(12).is_second());
}