MCPcopy Create free account
hub / github.com/distil/diffus / example

Function example

diffus/src/diffable_impls/set.rs:57–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55
56 #[test]
57 fn example() {
58 let unity: std::collections::HashSet<_, _> = [1, 2, 3].iter().cloned().collect();
59 let not_unity: std::collections::HashSet<_, _> = [1, 2, 4].iter().cloned().collect();
60
61 if let Edit::Change(diff) = unity.diff(&not_unity) {
62 assert!(diff[&1].is_copy());
63 assert!(diff[&2].is_copy());
64 assert!(diff[&3].is_remove());
65 assert_eq!(diff[&4].insert().unwrap(), &4);
66 } else {
67 unreachable!()
68 }
69 }
70}

Callers

nothing calls this directly

Calls 1

diffMethod · 0.45

Tested by

no test coverage detected