We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Getting error while flattening enum inside struct:
value: Error("can only flatten structs and maps", line: 6, column: 5)'
Source code: https://gist.github.com/r8d8/2940b5490a90204e5052809eae9b8868
serde version 1.0.51
serde
The text was updated successfully, but these errors were encountered:
Thanks. Minimized:
#[macro_use] extern crate serde_derive; extern crate serde; extern crate serde_json; #[derive(Deserialize, Debug)] struct KdfParams { #[serde(flatten)] kdf: Kdf, } #[derive(Deserialize, Debug)] #[serde(untagged)] enum Kdf { Pbkdf2 { c: u32, }, } fn main() { let j = r#" {"c":0} "#; println!("{}", serde_json::from_str::<KdfParams>(j).unwrap_err()); }
Sorry, something went wrong.
I released Serde 1.0.53 with a fix -- after a cargo update your code should work as written.
cargo update
No branches or pull requests
Getting error while flattening enum inside struct:
Source code: https://gist.github.com/r8d8/2940b5490a90204e5052809eae9b8868
serde
version 1.0.51The text was updated successfully, but these errors were encountered: