Debian Codegraph @

/

debian rust-dissimilar 1.0.2-1debian librust-dissimilar-dev debian librust-dissimilar+default-dev debian librust-dissimilar-1-dev debian librust-dissimilar-1+default-dev debian librust-dissimilar-1.0-dev debian librust-dissimilar-1.0+default-dev debian librust-dissimilar-1.0.2-dev debian librust-dissimilar-1.0.2+default-dev cargo dissimilar 1.0.2 debianjsonmakefilemarkdownrustrust-c-abishelltomlyaml 20 files · 391 symbols
README (full)

Dissimilar: diff library with semantic cleanup

github crates.io docs.rs build status

This library is a port of the Diff component of Diff Match Patch to Rust. The diff implementation is based on Myers' diff algorithm but includes some semantic cleanups to increase human readability by factoring out commonalities which are likely to be coincidental.

Diff Match Patch was originally built in 2006 to power Google Docs.

[dependencies]
dissimilar = "1.0"

Compiler support: requires rustc 1.31+

Interface

Here is the entire API of the Rust implementation. It operates on borrowed strings and the return value of the diff algorithm is a vector of chunks pointing into slices of those input strings.

pub enum Chunk<'a> {
    Equal(&'a str),
    Delete(&'a str),
    Insert(&'a str),
}

pub fn diff(text1: &str, text2: &str) -> Vec<Chunk>;

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
dir .github/
dir benches/
dir debian/
dir src/
dir tests/
file .cargo_vcs_info.json
file .gitignore
file Cargo.toml
file Cargo.toml.orig
file LICENSE-APACHE
file LICENSE-MIT
file README.md