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

#19 in Text processing

Download history 24674/week @ 2019-07-31 25728/week @ 2019-08-07 25148/week @ 2019-08-14 25074/week @ 2019-08-21 26415/week @ 2019-08-28 28143/week @ 2019-09-04 24395/week @ 2019-09-11 28094/week @ 2019-09-18 29583/week @ 2019-09-25 31358/week @ 2019-10-02 30985/week @ 2019-10-09 32681/week @ 2019-10-16 35058/week @ 2019-10-23 33171/week @ 2019-10-30 37305/week @ 2019-11-06

76,864 downloads per month
Used in 540 crates (64 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