Add compaction support (#22)
This commit is contained in:
parent
ddb73d8351
commit
7e628d78d8
9 changed files with 712 additions and 19 deletions
48
examples/patience.rs
Normal file
48
examples/patience.rs
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
use similar::{Algorithm, TextDiff};
|
||||
|
||||
const OLD: &str = r#"
|
||||
[
|
||||
(
|
||||
Major,
|
||||
2,
|
||||
),
|
||||
(
|
||||
Minor,
|
||||
20,
|
||||
),
|
||||
(
|
||||
Value,
|
||||
0,
|
||||
),
|
||||
]
|
||||
"#;
|
||||
const NEW: &str = r#"
|
||||
[
|
||||
(
|
||||
Major,
|
||||
2,
|
||||
),
|
||||
(
|
||||
Minor,
|
||||
0,
|
||||
),
|
||||
(
|
||||
Value,
|
||||
0,
|
||||
),
|
||||
(
|
||||
Value,
|
||||
1,
|
||||
),
|
||||
]
|
||||
"#;
|
||||
|
||||
fn main() {
|
||||
println!(
|
||||
"{}",
|
||||
TextDiff::configure()
|
||||
.algorithm(Algorithm::Patience)
|
||||
.diff_lines(OLD, NEW)
|
||||
.unified_diff()
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue