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

#16 in Text processing

Download history 11603/week @ 2018-05-06 14457/week @ 2018-05-13 9408/week @ 2018-05-20 7912/week @ 2018-05-27 8377/week @ 2018-06-03 8337/week @ 2018-06-10 6711/week @ 2018-06-17 8319/week @ 2018-06-24 10289/week @ 2018-07-01 9192/week @ 2018-07-08 10734/week @ 2018-07-15 11420/week @ 2018-07-22 8854/week @ 2018-07-29

16,821 downloads per month

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
MIT license

Dependencies

Reverse deps