attrimpl 0.3.2

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
#[test]
fn tuple_struct_1() {
    #[attrimpl::attrimpl]
    struct TupleStruct1(#[attrimpl(from, into, deref_mut)] String);

    let mut value = TupleStruct1::from("test".to_string());
    assert_eq!(value.0, "test");

    value.push_str("ing");
    assert_eq!(*value, "testing");

    let s: String = value.into();
    assert_eq!(s, "testing");
}