Similar: A Diffing Library
Similar is a dependency free crate for Rust that implements different diffing algorithms and high level interfaces for it. It was originally inspired by pijul's diff library but has since changed significantly. This library was built for the insta snapshot testing library.
use ;
Screenshot

What's in the box?
- Myers' diff
- Patience diff
- Hunt-style diff
- Histogram diff
- Classic LCS table diff
- Diffing on arbitrary comparable sequences
- Line, word, character and grapheme level diffing
- Text and Byte diffing
- Unified diff generation
no_std Support
similar now enables std by default.
For no_std + alloc usage:
[]
= { = "3", = false }
Backend selection in no_std mode:
- default (
default-features = false):alloc::collections::BTreeMap default-features = false, features = ["hashbrown"]:hashbrown::HashMap
Related Projects
- insta snapshot testing library
- similar-asserts assertion library