#diff #text #compare #changes #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

#2052 in Text processing

Download history 73937/week @ 2023-11-04 72278/week @ 2023-11-11 56485/week @ 2023-11-18 58981/week @ 2023-11-25 67514/week @ 2023-12-02 54760/week @ 2023-12-09 53572/week @ 2023-12-16 28392/week @ 2023-12-23 52033/week @ 2023-12-30 58326/week @ 2024-01-06 74803/week @ 2024-01-13 73890/week @ 2024-01-20 72400/week @ 2024-01-27 75516/week @ 2024-02-03 70259/week @ 2024-02-10 60140/week @ 2024-02-17

288,087 downloads per month
Used in 1,290 crates (104 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