extern crate inter; use inter::Inter; #[test] fn it_converts_structs() { #[derive(Clone)] struct Source { field_a: String, field_b: isize, field_c: bool, }; #[derive(Inter)] #[from("Source")] struct Target { field_a: String, field_b: isize, }; let source = Source { field_a: "aleph".to_string(), field_b: 12, field_c: false, }; let source2 = source.clone(); let target: Target = source.into(); assert_eq!(source2.field_a, target.field_a); assert_eq!(source2.field_b, target.field_b); }