deepmerge 0.1.0

Deep merge functionality with policy-driven merging and derive macro support
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use deepmerge::prelude::*;

#[derive(DeepMerge, Debug)]
#[merge(policy(string = concat))]
struct Simple {
    name: String,
}

fn main() {
    let mut a = Simple { name: "hello".to_string() };
    let b = Simple { name: " world".to_string() };
    a.merge_with_policy(b, &DefaultPolicy);
    println!("Result: {:?}", a);
    println!("Expected: hello world");
}