In chapter 3, in the section entitled "Real-World Applications", it indicates we must add this to our dependencies in Cargo.toml:
[dependencies]
serde = "1.0"
serde_json = "1.0"
But for the code to run it should be:
[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Without these changes cargo build gives errors, such as:
error: cannot find derive macro `Serialize` in this scope
--> src/main.rs:4:10
|
4 | #[derive(Serialize, Deserialize, Debug)]