difference.rs
![](https://camo.githubusercontent.com/e1ac8a97f9d5cd476bf02bd8b1029a63dd401d9411267f2f4c42312af4a60b42/68747470733a2f2f696d672e736869656c64732e696f2f6372617465732f762f646966666572656e63652e737667)
A Rust text diffing library with built-in diffing assertion.
use difference::Changeset;
let changeset = Changeset::new("test", "tent", "");
assert_eq!(changeset.diffs, vec![
Difference::Same("te".to_string()),
Difference::Rem("s".to_string()),
Difference::Add("n".to_string()),
Difference::Same("t".to_string())
]);
Usage
Add the following to your Cargo.toml:
[dependencies]
difference = "2.0"
Now you can use the crate in your code
extern crate difference;
Using the binary
difference can also be used as a command-line application. The best way to install it is using:
$ cargo install --features=bin