4 releases
new 0.1.3 | Dec 20, 2024 |
---|---|
0.1.2 | Dec 17, 2024 |
0.1.1 | Dec 17, 2024 |
0.1.0 | Dec 17, 2024 |
#838 in Algorithms
225 downloads per month
42KB
968 lines
imara-mergy
A merge implementation using histogram diff algorithm
lib.rs
:
This library implements merging of two files using histogram diff.
In order to achieve this, it combines imara_diff
and
diffy
(hence the name).
Namely, it uses the public API of the former and vendors the private API of the latter, and bridges the gap between the types used.
It was created mainly for use in mergiraf
.
Usage
use imara_mergy::{merge, merge_options::MergeOptions};
let base = r#"my_struct_t instance = {
.a = 1,
.c = 3,
.e = 5,
};
"#;
let left = r#"my_struct_t instance = {
.a = 1,
.b = 2,
.c = 3,
.e = 5,
};
"#;
let right = r#"my_struct_t instance = {
.a = 1,
.c = 3,
.d = 4,
.e = 5,
};
"#;
let after_expected = r#"my_struct_t instance = {
.a = 1,
.b = 2,
.c = 3,
.d = 4,
.e = 5,
};
"#;
let opts = MergeOptions::default();
let after = merge(base, left, right, opts);
assert_eq!(after.unwrap(), after_expected);
Dependencies
~3MB
~49K SLoC