Crates.io | difference |
lib.rs | difference |
version | 2.0.0 |
source | src |
created_at | 2015-09-19 05:58:42.573289 |
updated_at | 2018-01-23 17:31:55.462599 |
description | A Rust text diffing and assertion library. |
homepage | |
repository | https://github.com/johannhof/difference.rs |
max_upload_size | |
id | 3068 |
size | 183,735 |
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())
]);
Add the following to your Cargo.toml:
[dependencies]
difference = "2.0"
Now you can use the crate in your code
extern crate difference;
difference can also be used as a command-line application. The best way to install it is using:
$ cargo install --features=bin