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
I'm not sure if this is a bug or expected. Here is a reproducible example:
#[test] fn minimal_example() { #[derive(Debug, Clone, Deserialize, Serialize, Default, PartialEq, Eq)] struct A { x: i32, } let value_before = A::default(); let res = ron::ser::to_string_pretty(&Value::serialize(&value_before).unwrap(), ron::ser::PrettyConfig::default()).unwrap(); let value_after: A = ron::from_str(&res).unwrap(); assert_eq!(value_before, value_after); }
The line let value_after: A = ron::from_str(&res).unwrap(); will trigger the panic.
let value_after: A = ron::from_str(&res).unwrap();
Here is another example:
#[test] fn minimal_example2() { #[derive(Debug, Clone, Deserialize, Serialize, Default, PartialEq, Eq)] enum B { #[default] A, B, C } #[derive(Debug, Clone, Deserialize, Serialize, Default, PartialEq, Eq)] struct A { x: i32, s: String, e: B, } let value = A::default(); let res1 = ron::ser::to_string_pretty(&value, ron::ser::PrettyConfig::default()).unwrap(); let res2 = ron::ser::to_string_pretty(&Value::serialize(&value).unwrap(), ron::ser::PrettyConfig::default()).unwrap(); println!("{res1}"); println!("{res2}"); }
---- stdout ---- ( x: 0, s: "", e: A, ) { "e": "A", "s": "", "x": 0, }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm not sure if this is a bug or expected. Here is a reproducible example:
The line
let value_after: A = ron::from_str(&res).unwrap();
will trigger the panic.Here is another example:
The text was updated successfully, but these errors were encountered: