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 5623/week @ 2018-06-14 7893/week @ 2018-06-21 9892/week @ 2018-06-28 9798/week @ 2018-07-05 9959/week @ 2018-07-12 10842/week @ 2018-07-19 10201/week @ 2018-07-26 11736/week @ 2018-08-02 9924/week @ 2018-08-09 9747/week @ 2018-08-16 8855/week @ 2018-08-23 9308/week @ 2018-08-30 8515/week @ 2018-09-06

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