Closed grindvoll closed 9 months ago
All modified lines are covered by tests :white_check_mark:
Comparison is base (
1ff0efa
) 100.00% compared to head (3dc831f
) 100.00%.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@grindvoll Thanks for the PR! It looks good to me once codecov is 100% and with the small CHANGELOG tweak.
@grindvoll Could you add a second test function to the new file, which just checks your motivating case, e.g.
#[test]
fn ron_struct_as_json_map() {
let json: serde_json::Value = ron::from_str("(f1: 0, f2: 1)").unwrap();
assert_eq!(
json,
serde_json::Value::Object(
[
(
String::from("f1"),
serde_json::Value::Number(serde_json::Number::from(0))
),
(
String::from("f2"),
serde_json::Value::Number(serde_json::Number::from(1))
),
]
.into_iter()
.collect()
)
);
}
This commit fixes an incoherence problem in the Deserializer implementation for fields in struct-encoded maps.
deserialize_str
was accepted, whiledeserialize_string
was rejected. This behavior caused a problem when deserializing e.g.serde_json::Values
from RON-files.CHANGELOG.md