v0.9.8
-
Implement serde::Deserializer for &serde_json::Value (#261)
This can be convenient for deserializing from indexed content:
let v = json!({ "m": { "serde": 1, "json": 100 } }); let m: BTreeMap<String, u8> = Deserialize::deserialize(&v["m"])?;
-
Add an entry API to the serde_json::Map type, just like what BTreeMap has (#236)
let mut map = serde_json::Map::new(); map.entry("serde").or_insert(json!(12)); match map.entry("serde") { Entry::Vacant(vacant) => { // can insert } Entry::Occupied(occupied) => { // can read, mutate, remove } } assert_eq!(map["serde"], 12);
-
Quit using voldemort types to parameterize the deserializer; this should make storing serde_json::Deserializer and StreamDeserializer in structs more convenient (#260)