text-diff

Crates.iotext-diff
lib.rstext-diff
version0.4.0
sourcesrc
created_at2015-07-10 07:45:17.345406
updated_at2015-12-11 23:59:11.698689
descriptionA Rust text diffing and assertion library.
homepage
repositoryhttps://github.com/johannhof/text-diff.rs
max_upload_size
id2575
size166,127
Johann Hofmann (johannhof)

documentation

https://johannhof.github.io/text-diff.rs/text_diff/index.html

README

text-diff.rs

A Rust text diffing library.

Documentation

Examples

let (dist, changeset) = diff("test", "tent", "");

assert_eq!(changeset, 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.text_diff]

git = "https://github.com/johannhof/text-diff.rs.git"

Now you can use the crate in your code

extern crate text_diff;

Using the binary

text-diff can also be used as a command-line application. The best way to install it is using rustle:

curl -sf https://raw.githubusercontent.com/brson/rustle/master/rustle.sh | sh -s -- https://github.com/johannhof/text-diff.rs
Commit count: 103

cargo fmt