example: a reminder that usize is assumed to be 8 bytes long (#188)
This commit is contained in:
parent
46712f7b13
commit
04b5ff5938
|
|
@ -18,7 +18,7 @@ fn main() {
|
||||||
|
|
||||||
let encoded: Vec<u8> = serialize(&world, Infinite).unwrap();
|
let encoded: Vec<u8> = serialize(&world, Infinite).unwrap();
|
||||||
|
|
||||||
// 8 bytes for the length of the vector, 4 bytes per float.
|
// 8 bytes for the length of the vector (usize), 4 bytes per float.
|
||||||
assert_eq!(encoded.len(), 8 + 4 * 4);
|
assert_eq!(encoded.len(), 8 + 4 * 4);
|
||||||
|
|
||||||
let decoded: World = deserialize(&encoded[..]).unwrap();
|
let decoded: World = deserialize(&encoded[..]).unwrap();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue