type-change
It can be converted to another type with the same name field.
Usage
use From;
// equal to follows
//
// impl From<Foo> for Bar {
// fn from(foo: Foo) -> Bar {
// Bar { id: foo.id, name: foo.name }
// }
// }
//
let foo = Foo ;
let bar = Bar ;
assert_eq!;
Notes
- Only struct with the same field name can be converted.
- All field names must match and be accessible.
Contributing
Thanks!