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

#13 in Text processing

Download history 11199/week @ 2018-10-13 10541/week @ 2018-10-20 10551/week @ 2018-10-27 11262/week @ 2018-11-03 11284/week @ 2018-11-10 10967/week @ 2018-11-17 10894/week @ 2018-11-24 12607/week @ 2018-12-01 12734/week @ 2018-12-08 11683/week @ 2018-12-15 8076/week @ 2018-12-22 9961/week @ 2018-12-29 11508/week @ 2019-01-05 11262/week @ 2019-01-12 11584/week @ 2019-01-19

16,821 downloads per month
Used in 261 crates (44 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