8 releases (4 breaking)
0.5.1 | Mar 10, 2023 |
---|---|
0.5.0 | Feb 27, 2023 |
0.4.1 | Feb 1, 2021 |
0.4.0 | Mar 24, 2020 |
0.1.0 | Nov 29, 2018 |
#552 in Algorithms
6,883 downloads per month
Used in 13 crates
(6 directly)
25KB
645 lines
A generic diff library in Rust
This is an LCS-based diff library that works on slices of types implementing PartialEq
.
lib.rs
:
Various diff (longest common subsequence) algorithms, used in practice:
-
Myers' diff, in time O((N+M)D) and space O(N+M), where N and M are the sizes of the old and new version, respectively. See the original article by Eugene W. Myers.
-
Patience diff, in time O(N log N + M log M + (N+M)D), and space O(N+M), which tends to give more human-readable outputs. See Bram Cohen's blog post describing it.