summary refs log blame commit diff stats
path: root/tests/foobar.rs
blob: 8495ccbc5ddccd6987b628e3575fa336577546da (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

















                                                                        
#[derive(serde::Serialize)]
struct Foo {
    s: String,
}

#[derive(serde::Deserialize)]
struct Bar {
    s: String,
}

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