serde-json-core
serde-json-core copied to clipboard
deserialize_str with escaped strings is broken
trafficstars
serde_json_core needs to refuse deserializing a borrowed string with escape sequences.
serde_json_core::from_slice::<&str>(br#""\n""#) incorrectly gives Ok(("\\n", 4)).
serde_json::from_slice::<&str>(br#""\n""#) correctly says Error("invalid type: string \"\\n\", expected a borrowed string", line: 1, column: 4).