Merging keys then deserializing `.nan`, `.inf`, or `-.inf` into a `f32` or `f64` results in an error.
Merging keys then deserializing .nan
, .inf
, or -.inf
into a f32
or f64
results in an error.
I have not tested without the serde_yaml
feature as that as my program uses that feature.
Not merging keys does not produce this issue, but my program needs to merge keys, unlike the example below.
Minimum example
Manifest
[package]
name = "yaml-merge-keys_issue"
version = "0.1.0"
[dependencies]
serde_yaml = "0.8"
yaml-merge-keys = { version = "0.5", features = ["serde_yaml"] }
main.rs
fn main() {
let value: Result<f32, _> = serde_yaml::from_value(
yaml_merge_keys::merge_keys_serde(serde_yaml::from_str(".nan").unwrap()).unwrap(),
);
println!("value: {:?}", value);
}
Output:
value: Err(Message("invalid type: string \".nan\", expected f32", None))
Expected:
value: Ok(NaN)
Cargo package of example: yaml-merge-keys_issue.zip