likewise/examples/patience.rs
2021-02-25 22:13:43 +01:00

48 lines
557 B
Rust

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()
);
}