diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /vendor/diff/README.md | |
parent | Initial commit. (diff) | |
download | rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip |
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/diff/README.md')
-rw-r--r-- | vendor/diff/README.md | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/vendor/diff/README.md b/vendor/diff/README.md new file mode 100644 index 000000000..6447f5e54 --- /dev/null +++ b/vendor/diff/README.md @@ -0,0 +1,46 @@ +# diff.rs + +> An LCS based slice and string diffing implementation. + +## Install + +```toml +[dependencies] +diff = "0.1" +``` + +## Example + +```rust +extern crate diff; + +fn main() { + let left = "foo\nbar\nbaz\nquux"; + let right = "foo\nbaz\nbar\nquux"; + + for diff in diff::lines(left, right) { + match diff { + diff::Result::Left(l) => println!("-{}", l), + diff::Result::Both(l, _) => println!(" {}", l), + diff::Result::Right(r) => println!("+{}", r) + } + } +} +``` + +prints + +``` + foo +-bar + baz ++bar + quux +``` + +## License + +`diff` is primarily distributed under the terms of both the MIT license and the +Apache License (Version 2.0). + +See LICENSE-APACHE, and LICENSE-MIT for details. |