attrimpl 0.1.3

The crate provides attributes to automatically implement common traits and reduce boilerplate code.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[test]
fn named_struct_test() {
    #[attrimpl::attrimpl]
    struct NamedStruct {
        #[attrimpl(from, into)]
        // #[attrimpl(deref_both)]
        // #[attrimpl(as_ref, as_mut)]
        name: String,
    }

    let value = Box::<NamedStruct>::from("test".to_string());
    assert_eq!(value.name, "test");

    let value: String = (*value).into();
    assert_eq!(value, "test");
}