twitter-clone-rust icon indicating copy to clipboard operation
twitter-clone-rust copied to clipboard

error: cannot find derive macro `Deserialize` in this scope

Open ghost opened this issue 2 years ago • 0 comments

[main] error: cannot find derive macro Deserialize in this scope [Build] --> src/like.rs:12:17 [Build] | [Build] 12 | #[derive(Debug, Deserialize, Serialize)] [Build] | ^^^^^^^^^^^ [Build] | [Build] note: Deserialize is imported here, but it is only a trait, without a derive macro [Build] --> src/like.rs:4:13 [Build] | [Build] 4 | use serde::{Deserialize, Serialize}; [Build] | ^^^^^^^^^^^ [Build]

The solution is to include this Deserialize feature in Cargo.toml: serde = { version = "1.0", features = ["derive"] }

ghost avatar May 01 '23 12:05 ghost