tree: bbfca0af6dfdb6fef89a89f4beaf75c560709e65 [path history] [tgz]
  1. .cargo-checksum.json
  2. .travis.yml
  3. Cargo.toml
  4. Examples.md
  5. LICENSE
  6. README.md
  7. appveyor.yml
  8. assets/
  9. examples/
  10. rustfmt.toml
  11. src/
  12. tests/
rustc_deps/vendor/difference/README.md

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