serde-rs / json

Strongly typed JSON library for Rust
Apache License 2.0
4.7k stars 536 forks source link

Implement `Deserializer` for `Map<String, Value>` and `&Map<String, Value>` #1135

Open swlynch99 opened 2 months ago

swlynch99 commented 2 months ago

This PR adds Deserializer impls for Map<String, Value> and &Map<String, Value> and IntoDeserializer impls for the same. The first commit moves the relevant code from the value Deserializer impl into the new map impls. The last two are some small cleanups to use the map deserializer impl directly.

I put the Deserializer trait impls in src/value/de.rs so that they can reuse the existing helpers there. If you would prefer that they go elsewhere I am happy to move them.

Closes #1134