@@ -13,9 +13,9 @@ fn test_struct_info_roundtrip() {
1313 let de_s = serde_json:: from_str ( & struct_json) . unwrap ( ) ;
1414 assert_eq ! ( s, de_s) ;
1515
16- // Bincode
17- let encoded: Vec < u8 > = bincode :: serialize ( & s) . unwrap ( ) ;
18- let decoded: ItemEnum = bincode :: deserialize ( & encoded) . unwrap ( ) ;
16+ // Postcard
17+ let encoded: Vec < u8 > = postcard :: to_allocvec ( & s) . unwrap ( ) ;
18+ let decoded: ItemEnum = postcard :: from_bytes ( & encoded) . unwrap ( ) ;
1919 assert_eq ! ( s, decoded) ;
2020}
2121
@@ -33,9 +33,9 @@ fn test_union_info_roundtrip() {
3333 let de_u = serde_json:: from_str ( & union_json) . unwrap ( ) ;
3434 assert_eq ! ( u, de_u) ;
3535
36- // Bincode
37- let encoded: Vec < u8 > = bincode :: serialize ( & u) . unwrap ( ) ;
38- let decoded: ItemEnum = bincode :: deserialize ( & encoded) . unwrap ( ) ;
36+ // Postcard
37+ let encoded: Vec < u8 > = postcard :: to_allocvec ( & u) . unwrap ( ) ;
38+ let decoded: ItemEnum = postcard :: from_bytes ( & encoded) . unwrap ( ) ;
3939 assert_eq ! ( u, decoded) ;
4040}
4141
@@ -59,7 +59,7 @@ mod rkyv {
5959 /// A test to exercise the (de)serialization roundtrip for a representative selection of types,
6060 /// covering most of the rkyv-specific attributes we had to had.
6161 fn test_rkyv_roundtrip ( ) {
62- // Standard derives: a plain struct and union, mirroring the existing serde/bincode tests.
62+ // Standard derives: a plain struct and union, mirroring the existing serde/postcard tests.
6363 let s = ItemEnum :: Struct ( Struct {
6464 generics : Generics { params : vec ! [ ] , where_predicates : vec ! [ ] } ,
6565 kind : StructKind :: Plain { fields : vec ! [ Id ( 1 ) , Id ( 2 ) ] , has_stripped_fields : false } ,
0 commit comments