4 releases (2 stable)

2.0.0 Jan 23, 2018
1.0.0 Feb 9, 2017
0.4.1 Oct 9, 2015
0.4.0 Sep 19, 2015

#14 in Text processing

Download history 8037/week @ 2018-09-19 9567/week @ 2018-09-26 10482/week @ 2018-10-03 9854/week @ 2018-10-10 11257/week @ 2018-10-17 9736/week @ 2018-10-24 11177/week @ 2018-10-31 10984/week @ 2018-11-07 11515/week @ 2018-11-14 11228/week @ 2018-11-21 10633/week @ 2018-11-28 12552/week @ 2018-12-05 10350/week @ 2018-12-12

16,821 downloads per month
Used in 216 crates (39 directly)

MIT license

148KB
475 lines

difference.rs

A Rust text diffing library with built-in diffing assertion.

Documentation

Examples

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

Dependencies