vg-batteries 0.1.0

glimpse into my personal madness
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use serde_json::Value;

pub fn merge(a: &mut Value, b: Value) {
    match (a, b) {
        (a @ &mut Value::Object(_), Value::Object(b)) => {
            let a = a.as_object_mut().unwrap();
            for (k, v) in b {
                merge(a.entry(k).or_insert(Value::Null), v);
            }
        }
        (a, b) => *a = b,
    }
}