PackageTrack
Sign in Get early access

similar

A diff library for Rust

3.2.0 181M downloads/mo #544 most downloaded on crates.io mitsuhiko/similar

What this package is like to depend on

Last release 6 days ago

17 Aug 2026

Release timing varies

gaps range from 9 days to 1.2 years

Nearly every release is documented

notes for 25 of 25 stable releases

Nothing withdrawn

no release was ever pulled

6 years old

25 releases · first in 2021

5 releases in the last 12 months

see the full history below

Release timeline

25 releases · Jan 2021 to Aug 2026
2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 25
  1. 3.2.0 17 Aug 2026
    Release notes

    chore(release): prepare 3.2.0

    Open source →
    Release notes
    • Added structured, line-oriented three-way merging through TextMerge, with merge and diff3 conflict output, configurable labels and marker sizes, owned and borrowed inputs, byte output, and whitespace-insensitive comparison.
    • Added WhitespaceMode and TextDiffConfig::whitespace_mode for Git-style line comparisons that ignore changes in whitespace (-b) or all whitespace (-w).
    • Changed Algorithm::Myers to reduce unmatched/confusing records and use Git-style bounded, non-minimal splits on expensive searches, and added Algorithm::RawMyers for the previous shortest-edit-script behavior without output-changing heuristics.
    • Improved heuristics and performance for most algorithms other than LCS.
    • Improved large-input performance by avoiding quadratic Histogram scans.
    Open source →
  2. 3.1.2 04 Aug 2026
    Release notes

    chore(release): prepare 3.1.2

    Open source →
    Release notes
    • Fixed Algorithm::Lcs deadline fallback emitting edits twice, which produced out-of-bounds DiffOp ranges and panics when consuming timed-out diffs. #97
    • Fixed Algorithm::Lcs reporting identical subranges with zero-based indices instead of preserving the supplied range offsets. #98
    • Fixed Algorithm::Lcs and Algorithm::Hunt emitting zero-length delete operations when both inputs are empty. #99
    Open source →
  3. 3.1.1 23 May 2026
    Release notes

    chore(release): prepare 3.1.1

    Open source →
    Release notes
    • Fixed DiffOp cursor positions when compacting adjacent inserts/deletes and in Algorithm::Histogram full-replacement output, ensuring operations form contiguous ranges. #95
    • Renamed sample diff input files to a lexicographic caseNN.01.before_* / caseNN.02.after_* scheme.
    Open source →
  4. 3.1.0 11 Apr 2026
    Release notes

    chore(release): prepare 3.1.0

    Open source →
    Release notes
    • Added capture_diff_slices_by_key and capture_diff_slices_by_key_deadline as convenience helpers for diffing slices by derived keys.
    • Fixed Compact emitting inconsistent DiffOp cursor positions after compaction, which could leave Delete/Insert operations with stale new_index/old_index values.
    • Added explicit lifetime capture (+ use<...>) on iterator-returning APIs to improve compatibility with Rust 2024 lifetime capture behavior. #93
    Open source →
  5. 3.0.0 01 Apr 2026
    Release notes

    fix(ci): configure crates.io trusted publishing

    Open source →
    Release notes
    • Added a Git-style Histogram diff implementation exposed as Algorithm::Histogram, including deadline-aware Myers fallback and comprehensive regression/behavior tests.
    • Raised MSRV to Rust 1.85 and moved the crate to Rust 2024 edition.
    • Added a Hunt-style diff implementation exposed as Algorithm::Hunt.
    • Added configurable inline refinement via InlineChangeOptions and InlineChangeMode, including semantic cleanup and new TextDiff::iter_inline_changes_with_options* methods. #92
    • Added a global disjoint-input fast path in algorithms::diff_deadline to avoid pathological runtimes on large, fully distinct inputs.
    • Improved Algorithm::Myers performance on heavily unbalanced diffs to avoid pathological slowdowns.
    • Added diff_deadline_raw entrypoints in the algorithm modules to bypass shared heuristics and keep minimal intrinsic trait bounds where needed.
    • Added test files in examples/diffs that can be used with the some of the examples as input pairs.
    • Added CachedLookup, a helper for adapting virtual or computed sequences by materializing items on first access and then serving borrowed values through normal indexing. The owned-lookup example demonstrates this approach for issue #33.
    • Fixed ranged indexing in the classic LCS table algorithm.
    • Improved diff compaction to merge adjacent delete hunks across equal runs.
    • Excluded development scripts from published crate contents. #87
    • TextDiff::from_* and TextDiffConfig::diff_* now accept owned inputs (String, Vec<u8>, Cow) in addition to borrowed inputs. This allows returning text diffs from functions without external owner lifetimes. #65
    • TextDiff no longer exposes old_slices / new_slices. Use old_len, new_len, old_slice, new_slice, iter_old_slices, iter_new_slices, old_lookup, and new_lookup instead.
    • TextDiff::iter_changes now panics on invalid out-of-bounds DiffOp ranges instead of silently truncating iteration.
    • utils::diff_lines_inline now takes &TextDiff and options rather than (Algorithm, old, new, options).
    • utils::diff_lines now avoids a second line-tokenization pass.
    • Renamed get_diff_ratio to diff_ratio.
    • Added first-class no_std + alloc support with an explicit default std feature.
    • Added optional hashbrown backend for no_std map storage (default-features = false, features = ["hashbrown"]), while the default no_std backend uses alloc::collections::BTreeMap.
    • Made core constructors const-ready (Capture::new, Replace::new, NoFinishHook::new, InlineChangeOptions::new, TextDiff::configure).
    Open source →
  6. 2.7.0 19 Jan 2025
    Release notes
    • Add optional support for web-time to support web WASM targets. #73
    • Crate will no longer panic wheh deadlines are used in WASM. At worst deadlines are silently ignored. To enforce deadlines enable the wasm32_web_time feature. #74
    Open source →
  7. 2.6.0 21 Jul 2024
    Release notes
    • Bump bstr dependency to 1.5. #69
    Open source →
  8. 2.5.0 28 Mar 2024
    Release notes
    • Added support for TextDiff::iter_inline_changes_deadline. #61
    • Raise MSRV to 1.60. #62
    • Bump bstr dependency to 1.0. #62
    Open source →
  9. 2.4.0 29 Dec 2023
    Release notes
    • Fixed a bug where the LCS diff algorithm didn't always call D::finish. (#58)
    • Fixed a bug in LCS that caused a panic if the common prefix and the common suffix overlapped. (#59)
    Open source →
  10. 2.3.0 07 Oct 2023
    Release notes
    • Added support for Change::value_ref and Change::value_mut.
    Open source →
  11. 2.2.1 14 Nov 2022
    Release notes
    • Fixed a panic in LCS diffs on matching input. (#43)
    Open source →
  12. 2.2.0 01 Aug 2022
    Release notes
    • Fixed a panic in text diff generation. (#37)
    Open source →
  13. 2.1.0 03 Oct 2021
    Release notes
    • Removed deprecated alternative slice diffing functions.
    • Added serde feature to allow serialization with serde.
    Open source →
  14. 2.0.0 11 Sep 2021
    Release notes
    • Change the Change type and associated methods to work on any T: Clone instead of &T. This makes the iter_changes method also work on slices of integers or other values.
    Open source →
  15. 1.3.0 25 Feb 2021
    Release notes
    • Performance improvements for the LCS algorithm.
    • Small performance improvements by adding an early opt-out for and inline highlighting.
    • Added IdentifyDistinct to convert sequences to ints.
    • Small performance improvements for larger text diffs by using IdentifyDistinct automatically above a threshold.
    • Added deadlines to all diffing algorithms to bail early.
    • Deprecated slice diffing methods in the individual algorithm modules.
    • Use a default timeout for the inline highlighting feature.
    • Added a compacting step to clean up diffs. This results in nicer looking diffs and fewer edits. This is happening automatically for captured diffs and is exposed through the Capture type.
    • Fix incorrect ranges in unified diff output.
    Open source →
  16. 1.2.2 15 Feb 2021
    Release notes
    • Added support for Rust 1.41.0 for better compatibility.
    Open source →
  17. 1.2.1 15 Feb 2021
    Release notes
    • Added support for Rust 1.43.0 for better compatibility.
    Open source →
  18. 1.2.0 15 Feb 2021
    Release notes
    • Make the unicode feature optional for inline diffing.
    • Added Hunt–McIlroy LCS algorithm (lcs).
    • Changed the implementation of Mayer's diff. This has slightly changed the behavior but resulted in significantly improved performance and more readable code.
    • Added NoFinishHook to aid composing of diff hooks.
    Open source →
  19. 1.1.0 06 Feb 2021
    Release notes
    • More generic lifetimes for iter_changes and iter_inline_changes.
    • Added iter_all_changes shortcut as this is commonly useful.
    • Added iter_slices to DiffOp to quickly get an iterator over the encoded slices rather than individual items like iter_changes does.
    • Added the utils module with various text diffing utilities.
    • Added TextDiffRemapper which helps with working with the original, pre TextDiff tokenization slices.
    Open source →
  20. 1.0.0 03 Feb 2021
    Release notes
    • Add get_diff_ratio.
    • Add support for byte diffing and change the text interface to abstract over DiffableStr.
    • Restructured crate layout greatly. Text diffing is now on the crate root, some functionality remains in the algorithms.
    • The Change type now also works for non text diffs.
    Open source →
  21. 0.5.0 01 Feb 2021
    Release notes
    • Add DiffOp::apply_to_hook to apply a captured op to a diff hook.
    • Added missing newline handling to the Changes type.
    • Made unified diff support more flexible through the introduction of the UnifiedDiff type.
    • Fixed grouped diff operation to return an empty result if the diff does not show any changes.
    • Added inline diff highlighting support.
    • Changed word splitting to split into words and whitespace.
    • Added support for unicode based word splitting (TextDiff::from_unicode_words).
    Open source →
  22. 0.4.0 30 Jan 2021
    Release notes
    • Change get_close_matches to use Python's quick ratio optimization and order lexicographically when tied.
    Open source →
  23. 0.3.0 24 Jan 2021
    Release notes
    • Added grapheme and character level diffing utilities.
    • DiffOp::as_tag_tuple is now taking the argument by reference.
    • Added TextDiff::ratio.
    • Added get_close_matches.
    Open source →
  24. 0.2.0 24 Jan 2021
    Release notes
    • Fixed a bug in the patience algorithm causing it not not work.
    Open source →
  25. 0.1.0 24 Jan 2021
    Release notes
    • Initial release.
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive