]> git.proxmox.com Git - rustc.git/blob - vendor/difference/README.md
New upstream version 1.59.0+dfsg1
[rustc.git] / vendor / difference / README.md
1 # difference.rs [![](https://travis-ci.org/johannhof/difference.rs.svg?branch=master)](https://travis-ci.org/johannhof/difference.rs) [![](https://ci.appveyor.com/api/projects/status/n1nqaitd5uja8tsi/branch/master?svg=true)](https://ci.appveyor.com/project/johannhof/liquid-rust/branch/master) [![](https://coveralls.io/repos/johannhof/difference.rs/badge.svg?branch=master&service=github)](https://coveralls.io/github/johannhof/difference.rs?branch=master) [![](https://img.shields.io/crates/v/difference.svg)](https://crates.io/crates/difference)
2 A Rust text diffing library with built-in diffing assertion.
3
4 __[Documentation](https://johannhof.github.io/difference.rs)__
5
6 __[Examples](/Examples.md)__
7
8 ```rust
9 use difference::Changeset;
10
11 let changeset = Changeset::new("test", "tent", "");
12
13 assert_eq!(changeset.diffs, vec![
14 Difference::Same("te".to_string()),
15 Difference::Rem("s".to_string()),
16 Difference::Add("n".to_string()),
17 Difference::Same("t".to_string())
18 ]);
19 ```
20
21 ![](https://raw.githubusercontent.com/johannhof/difference.rs/master/assets/fox.png)
22 ![](https://raw.githubusercontent.com/johannhof/difference.rs/master/assets/github-style.png)
23
24 Usage
25 ----------
26
27 Add the following to your Cargo.toml:
28
29 ```toml
30 [dependencies]
31 difference = "2.0"
32 ```
33
34 Now you can use the crate in your code
35 ```rust
36 extern crate difference;
37 ```
38
39 Using the binary
40 -----------------
41
42 difference can also be used as a command-line application. The best way to install it is using:
43
44 ```sh
45 $ cargo install --features=bin
46 ```