The conversion of Value into a type fails in the following code snippet:
/*
[dependencies]
serde = { version = "=1.0.181", features = ["derive"] }
ron = "*"
*/
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
#[serde(tag = "type", content = "value")]
enum TheEnum {
Variant([f32; 3]),
}
fn main() {
let ron_value: ron::Value = ron::from_str("(type: \"Variant\", value: (0.1, 0.1, 0.1),)").unwrap();
println!("--- deserialized as ron::Value ---\n{ron_value:#?}\n");
ron_value.into_rust::<TheEnum>().unwrap();
}
The code panics on any serde version higher than 1.0.180, while it's totally fine on 1.0.180 or lower versions:
InvalidValueForType { expected: "variant of enum TheEnum", found: "the string \"Variant\"" }
Edit: I also checked serde_json with the same enum and it works with any serde version.
The conversion of
Valueinto a type fails in the following code snippet:The code panics on any
serdeversion higher than1.0.180, while it's totally fine on1.0.180or lower versions:Edit: I also checked
serde_jsonwith the same enum and it works with anyserdeversion.