Differ is a Rust library for finding the differences between two sequences.
The sequences can be vectors of lines, strings (e.g., words), characters,
bytes, or of any custom “item” type so long as it implements the
Hash
and Eq
traits (and uses the same data for both).
For your Cargo.toml
add this to the [dependencies]
section:
differ = "1.0.2"
If you want to be able to serialize or deserialize
Match
es, Span
s, or Tag
s, use:
differ = { version = "1.0.2", features = ["use_serde"] }
Then, in your crate root, for Rust 2015 add extern crate
differ
, and for Rust 2018 or 2021 add use differ
.
API documentation (with examples) — Source code: github.
span_for_matches()
method to be a
function and added a few more tests and did some minor doc improvements.
(Note that this crate is now used in private projects which do
lots more tests of its functionality than the tests in the source
code.)Tag
s using the Display
trait (i.e., as “equal”, “replace”, etc.).Match
es, Span
s, and Tag
s.Your Privacy • Copyright © 2006 Qtrac Ltd. All Rights Reserved.