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 42239/week @ 2019-12-02 38925/week @ 2019-12-09 40497/week @ 2019-12-16 23156/week @ 2019-12-23 28144/week @ 2019-12-30 40998/week @ 2020-01-06 42275/week @ 2020-01-13 42050/week @ 2020-01-20 41606/week @ 2020-01-27 40102/week @ 2020-02-03 39427/week @ 2020-02-10 34219/week @ 2020-02-17 38560/week @ 2020-02-24 41632/week @ 2020-03-02 42667/week @ 2020-03-09 43589/week @ 2020-03-16

151,105 downloads per month
Used in 703 crates (70 directly)

MIT license

150KB
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