blob: 98a58183552f3449b880a367634a505374d8b20e [file] [log] [blame] [edit]
use similar::TextDiff;
fn main() {
let diff = TextDiff::from_lines(
"Hello World\nThis is the second line.\nThis is the third.",
"Hallo Welt\nThis is the second line.\nThis is life.\nMoar and more",
);
let all_changes = diff
.ops()
.iter()
.flat_map(|op| diff.iter_changes(op))
.collect::<Vec<_>>();
println!("{}", serde_json::to_string_pretty(&all_changes).unwrap());
}