#[derive(serde::Serialize)] struct Foo(String); #[derive(serde::Deserialize)] struct Bar(String); #[test] fn transmute() { let settings = Default::default(); let foo = Foo(String::from("Hello!")); let bar: Bar = serde_transmute::transmute(&foo, &settings).unwrap(); assert_eq!(foo.0, bar.0); }