type-change

It can be converted to another type with the same name field.

Usage

```rust use type_change::From;

[derive(Clone)]

struct Foo { id: i64, name: String, }

[derive(From)]

[from(Foo)]

struct Bar { id: i64, name: String, }

// equal to follows // // impl From for Bar { // fn from(foo: Foo) -> Bar { // Bar { id: foo.id, name: foo.name } // } // } //

let foo = Foo { id: 1, name: "foo".tostring() }; let bar = Bar { name: "bar".tostring(), ..foo.clone().into() }; assert_eq!(foo.id, bar.id);

```

Notes

Contributing

Thanks!