Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 3 - Section Real World Applications - Cargo.toml dependency for serde needs text for feature "derive" #4

Open
glafrance opened this issue Sep 10, 2024 · 0 comments

Comments

@glafrance
Copy link

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)]
@glafrance glafrance changed the title Cargo.toml dependency for serde needs text for feature "derive" Chapter 3 - Section Real World Applications - Cargo.toml dependency for serde needs text for feature "derive" Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant