gary-core 0.0.1

core components shared by all things gary
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::config::ClusterConfig;
use serde_yaml::Value;

pub fn merge(a: &mut Value, b: &Value) {
    match (a, b) {
        (&mut Value::Mapping(ref mut a), &Value::Mapping(ref b)) => {
            for (k, v) in b {
                merge(a.get_mut(&k.clone()).unwrap(), v);
            }
        }
        (a, b) => {
            *a = b.clone();
        }
    }
}