mirror of https://git.sr.ht/~stygianentity/bincode
Add Debug derivation to structs of the example in README.md (#191)
The `assert_eq!` macro expects its arguments to satisfy the `Debug` trait as if and when it panics, it'll print out the `Debug` representation.
This commit is contained in:
parent
04b5ff5938
commit
43712ac366
|
|
@ -32,13 +32,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() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue