summary refs log blame commit diff stats
path: root/tests/unit.rs
blob: c18ee3185cf2fa3a2b998492b9154d1862f55e2f (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                                                        
#[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);
}