mirror of https://git.sr.ht/~stygianentity/bincode
readme: follow idiom (#187)
This commit is contained in:
parent
18b9225ab1
commit
46712f7b13
|
|
@ -51,7 +51,7 @@ fn main() {
|
|||
|
||||
let decoded: World = deserialize(&encoded[..]).unwrap();
|
||||
|
||||
assert!(world == decoded);
|
||||
assert_eq!(world, decoded);
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@ extern crate bincode;
|
|||
|
||||
use bincode::{serialize, deserialize, Infinite};
|
||||
|
||||
#[derive(Serialize, Deserialize, PartialEq)]
|
||||
#[derive(Serialize, Deserialize, PartialEq, Debug)]
|
||||
struct Entity {
|
||||
x: f32,
|
||||
y: f32,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, PartialEq)]
|
||||
#[derive(Serialize, Deserialize, PartialEq, Debug)]
|
||||
struct World(Vec<Entity>);
|
||||
|
||||
fn main() {
|
||||
|
|
@ -23,5 +23,5 @@ fn main() {
|
|||
|
||||
let decoded: World = deserialize(&encoded[..]).unwrap();
|
||||
|
||||
assert!(world == decoded);
|
||||
assert_eq!(world, decoded);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue