newtype 0.2.1

Custom Derive to give tuple structs newtype semantics
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use newtype::NewType;

struct Bar<T>(T);

#[derive(NewType)]
struct Foo<T>(Bar<T>);

#[test]
fn smoke() {
    let bar = Bar(5usize);
    let foo: Foo<usize> = bar.into();
    let _unwrapped = foo.into_inner();
}