A diff library written in rust
use diff::{diff, patch, pretty_print};
use std::io::stdout;
let from = vec!["this", "is", "an", "example"];
let to = vec!["this", "is", "another", "example"];
// generate the edit script
let changes = diff(&from, &to);Each edit in the diff is represented by a DiffItem
for edit in &changes {
print!("{}", *edit);
}// apply the first edit in the script
let patched = patch(&from, &changes[0]);pretty_print(stdout(), &from, &changes[0]);