Merge two JSON objects in Rust

This is the most shared code snippet on StackOverflow for merging two JSON objects in Rust: fn merge(a: &mut Value, b: Value) { if let Value::Object(a) = a { if let Value::Object(b) = b { for (k, v) in b { if v.is_null() { a.remove(&k); } else { merge(a.entry(k).or_insert(Value::Null), v); } } return; } } *a = b; } The pr...
Read post