#text #diff #compare #change #assert

unmaintained bin+lib difference

A Rust text diffing and assertion library

4 releases (2 stable)

Uses old Rust 2015

2.0.0 Jan 23, 2018
1.0.0 Feb 9, 2017
0.4.1 Oct 9, 2015
0.4.0 Sep 19, 2015

#1573 in Text processing

Download history 92035/week @ 2024-07-21 89675/week @ 2024-07-28 99747/week @ 2024-08-04 91999/week @ 2024-08-11 124412/week @ 2024-08-18 91171/week @ 2024-08-25 84353/week @ 2024-09-01 92109/week @ 2024-09-08 76972/week @ 2024-09-15 94624/week @ 2024-09-22 102093/week @ 2024-09-29 114554/week @ 2024-10-06 98526/week @ 2024-10-13 108840/week @ 2024-10-20 105926/week @ 2024-10-27 100414/week @ 2024-11-03

421,377 downloads per month
Used in 1,294 crates (106 directly)

MIT license

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