f2b5566c0b
The map visitor for Dynamic was expecting a &str for the key, but the serde_json deserializer internally uses a Cow string, which can be Borrowed or Owned. In the case of Owned, the serde_json key deserializer is calling visit_string on the Visitor, which for &str will result in the error: Error("invalid type: string \"a\", expected a borrowed string", line: 0, column: 0) smartstring actually has its own Visitor implementation that handles both cases, so we can use it instead of an explicit conversion. |
||
---|---|---|
.. | ||
de.rs | ||
deserialize.rs | ||
metadata.rs | ||
mod.rs | ||
ser.rs | ||
serialize.rs | ||
str.rs |