From 7e86fb2e5583163321417f7b28fc70b21a0f5ded Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 11 Sep 2025 13:31:09 -0500 Subject: [PATCH 01/18] feat: rename similar -> likewise --- Cargo.toml | 7 +- README.md | 23 ++-- examples/close-matches.rs | 2 +- examples/large.rs | 2 +- examples/nonstring.rs | 2 +- examples/original-slices.rs | 4 +- examples/patience.rs | 2 +- examples/serde.rs | 2 +- examples/terminal-inline.rs | 2 +- examples/terminal.rs | 2 +- examples/udiff.rs | 2 +- src/algorithms/mod.rs | 2 +- ...ms__capture__capture_hook_grouping-2.snap} | 0 ...thms__capture__capture_hook_grouping.snap} | 0 ...ikewise__algorithms__lcs__contiguous.snap} | 0 ...p => likewise__algorithms__lcs__diff.snap} | 0 ...ap => likewise__algorithms__lcs__pat.snap} | 0 ...p => likewise__algorithms__lcs__same.snap} | 1 - ...ewise__algorithms__myers__contiguous.snap} | 0 ..._algorithms__myers__deadline_reached.snap} | 0 ...=> likewise__algorithms__myers__diff.snap} | 0 ... => likewise__algorithms__myers__pat.snap} | 0 ...wise__algorithms__patience__patience.snap} | 0 ...patience__patience_out_of_bounds_bug.snap} | 0 src/algorithms/utils.rs | 4 +- src/lib.rs | 10 +- ...nap => likewise__udiff__unified_diff.snap} | 1 - ...__udiff__unified_diff_newline_hint-2.snap} | 3 +- ...se__udiff__unified_diff_newline_hint.snap} | 1 - src/text/mod.rs | 16 +-- ...snap => likewise__text__captured_ops.snap} | 0 ...=> likewise__text__captured_word_ops.snap} | 0 ...ff.snap => likewise__text__char_diff.snap} | 0 ...=> likewise__text__lifetimes_on_iter.snap} | 0 ...ops.snap => likewise__text__line_ops.snap} | 0 ...snap => likewise__text__unified_diff.snap} | 1 - ... => likewise__text__virtual_newlines.snap} | 0 ...imilar__text__inline__line_ops_inline.snap | 126 ------------------ .../similar__text__inline__serde.snap | 107 --------------- src/text/snapshots/similar__text__serde.snap | 55 -------- .../snapshots/similar__text__serde_ops.snap | 38 ------ src/types.rs | 8 +- src/udiff.rs | 4 +- src/utils.rs | 28 ++-- 44 files changed, 64 insertions(+), 391 deletions(-) rename src/algorithms/snapshots/{similar__algorithms__capture__capture_hook_grouping-2.snap => likewise__algorithms__capture__capture_hook_grouping-2.snap} (100%) rename src/algorithms/snapshots/{similar__algorithms__capture__capture_hook_grouping.snap => likewise__algorithms__capture__capture_hook_grouping.snap} (100%) rename src/algorithms/snapshots/{similar__algorithms__lcs__contiguous.snap => likewise__algorithms__lcs__contiguous.snap} (100%) rename src/algorithms/snapshots/{similar__algorithms__lcs__diff.snap => likewise__algorithms__lcs__diff.snap} (100%) rename src/algorithms/snapshots/{similar__algorithms__lcs__pat.snap => likewise__algorithms__lcs__pat.snap} (100%) rename src/algorithms/snapshots/{similar__algorithms__lcs__same.snap => likewise__algorithms__lcs__same.snap} (87%) rename src/algorithms/snapshots/{similar__algorithms__myers__contiguous.snap => likewise__algorithms__myers__contiguous.snap} (100%) rename src/algorithms/snapshots/{similar__algorithms__myers__deadline_reached.snap => likewise__algorithms__myers__deadline_reached.snap} (100%) rename src/algorithms/snapshots/{similar__algorithms__myers__diff.snap => likewise__algorithms__myers__diff.snap} (100%) rename src/algorithms/snapshots/{similar__algorithms__myers__pat.snap => likewise__algorithms__myers__pat.snap} (100%) rename src/algorithms/snapshots/{similar__algorithms__patience__patience.snap => likewise__algorithms__patience__patience.snap} (100%) rename src/algorithms/snapshots/{similar__algorithms__patience__patience_out_of_bounds_bug.snap => likewise__algorithms__patience__patience_out_of_bounds_bug.snap} (100%) rename src/snapshots/{similar__udiff__unified_diff.snap => likewise__udiff__unified_diff.snap} (99%) rename src/snapshots/{similar__udiff__unified_diff_newline_hint-2.snap => likewise__udiff__unified_diff_newline_hint-2.snap} (57%) rename src/snapshots/{similar__udiff__unified_diff_newline_hint.snap => likewise__udiff__unified_diff_newline_hint.snap} (99%) rename src/text/snapshots/{similar__text__captured_ops.snap => likewise__text__captured_ops.snap} (100%) rename src/text/snapshots/{similar__text__captured_word_ops.snap => likewise__text__captured_word_ops.snap} (100%) rename src/text/snapshots/{similar__text__char_diff.snap => likewise__text__char_diff.snap} (100%) rename src/text/snapshots/{similar__text__lifetimes_on_iter.snap => likewise__text__lifetimes_on_iter.snap} (100%) rename src/text/snapshots/{similar__text__line_ops.snap => likewise__text__line_ops.snap} (100%) rename src/text/snapshots/{similar__text__unified_diff.snap => likewise__text__unified_diff.snap} (99%) rename src/text/snapshots/{similar__text__virtual_newlines.snap => likewise__text__virtual_newlines.snap} (100%) delete mode 100644 src/text/snapshots/similar__text__inline__line_ops_inline.snap delete mode 100644 src/text/snapshots/similar__text__inline__serde.snap delete mode 100644 src/text/snapshots/similar__text__serde.snap delete mode 100644 src/text/snapshots/similar__text__serde_ops.snap diff --git a/Cargo.toml b/Cargo.toml index b7ee0d5..d6e5ff4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,8 @@ [package] -name = "similar" +name = "likewise" version = "2.7.0" authors = [ + "Barrett Ruth ", "Armin Ronacher ", "Pierre-Étienne Meunier ", "Brandon Williams ", @@ -9,8 +10,8 @@ authors = [ edition = "2018" rust-version = "1.60" license = "Apache-2.0" -description = "A diff library for Rust" -repository = "https://github.com/mitsuhiko/similar" +description = "A diff library for Rust (fork of similar)" +repository = "https://github.com/barrett-ruth/likewise" keywords = ["diff", "difference", "patience", "compare", "changes"] readme = "README.md" exclude = ["assets/*"] diff --git a/README.md b/README.md index dd5c37f..61dc646 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@ -# Similar: A Diffing Library +# Likewise: A Diffing Library -[![Crates.io](https://img.shields.io/crates/d/similar.svg)](https://crates.io/crates/similar) -[![License](https://img.shields.io/github/license/mitsuhiko/similar)](https://github.com/mitsuhiko/similar/blob/main/LICENSE) +> This crate is a fork of [similar](https://github.com/mitsuhiko/similar) library, which, as of 11/9/25, is rather inactive. + +[![Crates.io](https://img.shields.io/crates/d/likewise.svg)](https://crates.io/crates/likewise) +[![License](https://img.shields.io/github/license/frozen/likewise)](https://github.com/frozen/likewise/blob/main/LICENSE) [![rustc 1.60.0](https://img.shields.io/badge/rust-1.60%2B-orange.svg)](https://img.shields.io/badge/rust-1.60%2B-orange.svg) -[![Documentation](https://docs.rs/similar/badge.svg)](https://docs.rs/similar) +[![Documentation](https://docs.rs/likewise/badge.svg)](https://docs.rs/likewise) -Similar is a dependency free crate for Rust that implements different diffing +Likewise is a dependency free crate for Rust that implements different diffing algorithms and high level interfaces for it. It is based on the [pijul](https://pijul.org/) implementation of the Patience algorithm and inherits some ideas from there. It also incorporates the Myers' diff @@ -13,7 +15,7 @@ algorithm which was largely written by Brandon Williams. This library was built for the [insta snapshot testing library](https://insta.rs). ```rust -use similar::{ChangeTag, TextDiff}; +use likewise::{ChangeTag, TextDiff}; fn main() { let diff = TextDiff::from_lines( @@ -48,12 +50,13 @@ fn main() { ## Related Projects +* [similar](https://github.com/mitsuhiko/similar) * [insta](https://insta.rs) snapshot testing library * [similar-asserts](https://github.com/mitsuhiko/similar-asserts) assertion library ## License and Links -* [Documentation](https://docs.rs/similar/) -* [Issue Tracker](https://github.com/mitsuhiko/similar/issues) -* [Examples](https://github.com/mitsuhiko/similar/tree/main/examples) -* License: [Apache-2.0](https://github.com/mitsuhiko/similar/blob/main/LICENSE) +* [Documentation](https://docs.rs/likewise/) +* [Issue Tracker](https://github.com/barrett-ruth/likewise/issues) +* [Examples](https://github.com/barrett-ruth/likewise/tree/main/examples) +* License: [Apache-2.0](https://github.com/barrett-ruth/likewise/blob/main/LICENSE) diff --git a/examples/close-matches.rs b/examples/close-matches.rs index ebe283a..19293fc 100644 --- a/examples/close-matches.rs +++ b/examples/close-matches.rs @@ -1,4 +1,4 @@ -use similar::get_close_matches; +use likewise::get_close_matches; fn main() { let words = vec![ diff --git a/examples/large.rs b/examples/large.rs index 08200f8..383f7d9 100644 --- a/examples/large.rs +++ b/examples/large.rs @@ -1,4 +1,4 @@ -use similar::TextDiff; +use likewise::TextDiff; fn main() { let x = "abc".repeat(2000); diff --git a/examples/nonstring.rs b/examples/nonstring.rs index ca102e2..66a84fe 100644 --- a/examples/nonstring.rs +++ b/examples/nonstring.rs @@ -1,4 +1,4 @@ -use similar::{capture_diff_slices, Algorithm}; +use likewise::{capture_diff_slices, Algorithm}; fn main() { let old = vec![1, 2, 3]; diff --git a/examples/original-slices.rs b/examples/original-slices.rs index bdca420..81b0337 100644 --- a/examples/original-slices.rs +++ b/examples/original-slices.rs @@ -1,5 +1,5 @@ -use similar::utils::diff_chars; -use similar::Algorithm; +use likewise::utils::diff_chars; +use likewise::Algorithm; fn main() { let old = "1234567890abcdef".to_string(); diff --git a/examples/patience.rs b/examples/patience.rs index 4b898a6..2c63f6f 100644 --- a/examples/patience.rs +++ b/examples/patience.rs @@ -1,4 +1,4 @@ -use similar::{Algorithm, TextDiff}; +use likewise::{Algorithm, TextDiff}; const OLD: &str = r#" [ diff --git a/examples/serde.rs b/examples/serde.rs index 98a5818..a671f23 100644 --- a/examples/serde.rs +++ b/examples/serde.rs @@ -1,4 +1,4 @@ -use similar::TextDiff; +use likewise::TextDiff; fn main() { let diff = TextDiff::from_lines( diff --git a/examples/terminal-inline.rs b/examples/terminal-inline.rs index 4c5d74f..5168e7f 100644 --- a/examples/terminal-inline.rs +++ b/examples/terminal-inline.rs @@ -3,7 +3,7 @@ use std::fs::read; use std::process::exit; use console::{style, Style}; -use similar::{ChangeTag, TextDiff}; +use likewise::{ChangeTag, TextDiff}; struct Line(Option); diff --git a/examples/terminal.rs b/examples/terminal.rs index 1a90327..3743d39 100644 --- a/examples/terminal.rs +++ b/examples/terminal.rs @@ -1,5 +1,5 @@ use console::Style; -use similar::{ChangeTag, TextDiff}; +use likewise::{ChangeTag, TextDiff}; fn main() { let diff = TextDiff::from_lines( diff --git a/examples/udiff.rs b/examples/udiff.rs index 3d8eb9c..44f9429 100644 --- a/examples/udiff.rs +++ b/examples/udiff.rs @@ -2,7 +2,7 @@ use std::fs::read; use std::io; use std::process::exit; -use similar::TextDiff; +use likewise::TextDiff; fn main() { let args: Vec<_> = std::env::args_os().collect(); diff --git a/src/algorithms/mod.rs b/src/algorithms/mod.rs index 008ade5..0a43afc 100644 --- a/src/algorithms/mod.rs +++ b/src/algorithms/mod.rs @@ -21,7 +21,7 @@ //! between two sequences and capture the ops into a vector. //! //! ```rust -//! use similar::algorithms::{Algorithm, Replace, Capture, diff_slices}; +//! use likewise::algorithms::{Algorithm, Replace, Capture, diff_slices}; //! //! let a = vec![1, 2, 3, 4, 5]; //! let b = vec![1, 2, 3, 4, 7]; diff --git a/src/algorithms/snapshots/similar__algorithms__capture__capture_hook_grouping-2.snap b/src/algorithms/snapshots/likewise__algorithms__capture__capture_hook_grouping-2.snap similarity index 100% rename from src/algorithms/snapshots/similar__algorithms__capture__capture_hook_grouping-2.snap rename to src/algorithms/snapshots/likewise__algorithms__capture__capture_hook_grouping-2.snap diff --git a/src/algorithms/snapshots/similar__algorithms__capture__capture_hook_grouping.snap b/src/algorithms/snapshots/likewise__algorithms__capture__capture_hook_grouping.snap similarity index 100% rename from src/algorithms/snapshots/similar__algorithms__capture__capture_hook_grouping.snap rename to src/algorithms/snapshots/likewise__algorithms__capture__capture_hook_grouping.snap diff --git a/src/algorithms/snapshots/similar__algorithms__lcs__contiguous.snap b/src/algorithms/snapshots/likewise__algorithms__lcs__contiguous.snap similarity index 100% rename from src/algorithms/snapshots/similar__algorithms__lcs__contiguous.snap rename to src/algorithms/snapshots/likewise__algorithms__lcs__contiguous.snap diff --git a/src/algorithms/snapshots/similar__algorithms__lcs__diff.snap b/src/algorithms/snapshots/likewise__algorithms__lcs__diff.snap similarity index 100% rename from src/algorithms/snapshots/similar__algorithms__lcs__diff.snap rename to src/algorithms/snapshots/likewise__algorithms__lcs__diff.snap diff --git a/src/algorithms/snapshots/similar__algorithms__lcs__pat.snap b/src/algorithms/snapshots/likewise__algorithms__lcs__pat.snap similarity index 100% rename from src/algorithms/snapshots/similar__algorithms__lcs__pat.snap rename to src/algorithms/snapshots/likewise__algorithms__lcs__pat.snap diff --git a/src/algorithms/snapshots/similar__algorithms__lcs__same.snap b/src/algorithms/snapshots/likewise__algorithms__lcs__same.snap similarity index 87% rename from src/algorithms/snapshots/similar__algorithms__lcs__same.snap rename to src/algorithms/snapshots/likewise__algorithms__lcs__same.snap index 4b9511b..08568f7 100644 --- a/src/algorithms/snapshots/similar__algorithms__lcs__same.snap +++ b/src/algorithms/snapshots/likewise__algorithms__lcs__same.snap @@ -1,6 +1,5 @@ --- source: src/algorithms/lcs.rs -assertion_line: 235 expression: d.ops() --- [ diff --git a/src/algorithms/snapshots/similar__algorithms__myers__contiguous.snap b/src/algorithms/snapshots/likewise__algorithms__myers__contiguous.snap similarity index 100% rename from src/algorithms/snapshots/similar__algorithms__myers__contiguous.snap rename to src/algorithms/snapshots/likewise__algorithms__myers__contiguous.snap diff --git a/src/algorithms/snapshots/similar__algorithms__myers__deadline_reached.snap b/src/algorithms/snapshots/likewise__algorithms__myers__deadline_reached.snap similarity index 100% rename from src/algorithms/snapshots/similar__algorithms__myers__deadline_reached.snap rename to src/algorithms/snapshots/likewise__algorithms__myers__deadline_reached.snap diff --git a/src/algorithms/snapshots/similar__algorithms__myers__diff.snap b/src/algorithms/snapshots/likewise__algorithms__myers__diff.snap similarity index 100% rename from src/algorithms/snapshots/similar__algorithms__myers__diff.snap rename to src/algorithms/snapshots/likewise__algorithms__myers__diff.snap diff --git a/src/algorithms/snapshots/similar__algorithms__myers__pat.snap b/src/algorithms/snapshots/likewise__algorithms__myers__pat.snap similarity index 100% rename from src/algorithms/snapshots/similar__algorithms__myers__pat.snap rename to src/algorithms/snapshots/likewise__algorithms__myers__pat.snap diff --git a/src/algorithms/snapshots/similar__algorithms__patience__patience.snap b/src/algorithms/snapshots/likewise__algorithms__patience__patience.snap similarity index 100% rename from src/algorithms/snapshots/similar__algorithms__patience__patience.snap rename to src/algorithms/snapshots/likewise__algorithms__patience__patience.snap diff --git a/src/algorithms/snapshots/similar__algorithms__patience__patience_out_of_bounds_bug.snap b/src/algorithms/snapshots/likewise__algorithms__patience__patience_out_of_bounds_bug.snap similarity index 100% rename from src/algorithms/snapshots/similar__algorithms__patience__patience_out_of_bounds_bug.snap rename to src/algorithms/snapshots/likewise__algorithms__patience__patience_out_of_bounds_bug.snap diff --git a/src/algorithms/utils.rs b/src/algorithms/utils.rs index 76b8895..13501d0 100644 --- a/src/algorithms/utils.rs +++ b/src/algorithms/utils.rs @@ -166,8 +166,8 @@ impl Index for OffsetLookup { /// you first pass it via [`IdentifyDistinct`]: /// /// ```rust -/// use similar::capture_diff; -/// use similar::algorithms::{Algorithm, IdentifyDistinct}; +/// use likewise::capture_diff; +/// use likewise::algorithms::{Algorithm, IdentifyDistinct}; /// /// let old = &["foo", "bar", "baz"][..]; /// let new = &["foo", "blah", "baz"][..]; diff --git a/src/lib.rs b/src/lib.rs index 32eaec6..d0e2aff 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,7 +21,7 @@ //! diff an indexable object or slice and return a vector of [`DiffOp`] objects. //! //! ```rust -//! use similar::{Algorithm, capture_diff_slices}; +//! use likewise::{Algorithm, capture_diff_slices}; //! //! let a = vec![1, 2, 3, 4, 5]; //! let b = vec![1, 2, 3, 4, 7]; @@ -30,14 +30,14 @@ //! //! # Text Diffing //! -//! Similar provides helpful utilities for text (and more specifically line) diff +//! Likewise provides helpful utilities for text (and more specifically line) diff //! operations. The main type you want to work with is [`TextDiff`] which //! uses the underlying diff algorithms to expose a convenient API to work with //! texts: //! //! ```rust //! # #[cfg(feature = "text")] { -//! use similar::{ChangeTag, TextDiff}; +//! use likewise::{ChangeTag, TextDiff}; //! //! let diff = TextDiff::from_lines( //! "Hello World\nThis is the second line.\nThis is the third.", @@ -64,7 +64,7 @@ //! As a result there is a difference between `foo\n` and `foo` as far as diffs //! are concerned. //! -//! In similar this is handled on the [`Change`] or [`InlineChange`] level. If +//! In likewise this is handled on the [`Change`] or [`InlineChange`] level. If //! a diff was created via [`TextDiff::from_lines`] the text diffing system is //! instructed to check if there are missing newlines encountered //! ([`TextDiff::newline_terminated`] returns true). @@ -122,7 +122,7 @@ //! when performing a text diff. //! //! Note that on wasm targets calling [`Instant::now`] will result in a panic -//! unless you enable the `wasm32_web_time` feataure. By default similar will +//! unless you enable the `wasm32_web_time` feataure. By default likewise will //! silently disable the deadline checks internally unless that feature is //! enabled. //! diff --git a/src/snapshots/similar__udiff__unified_diff.snap b/src/snapshots/likewise__udiff__unified_diff.snap similarity index 99% rename from src/snapshots/similar__udiff__unified_diff.snap rename to src/snapshots/likewise__udiff__unified_diff.snap index 5345b0b..ae7a8fb 100644 --- a/src/snapshots/similar__udiff__unified_diff.snap +++ b/src/snapshots/likewise__udiff__unified_diff.snap @@ -22,4 +22,3 @@ expression: "&diff.unified_diff().header(\"a.txt\", \"b.txt\").to_string()" P Q R - diff --git a/src/snapshots/similar__udiff__unified_diff_newline_hint-2.snap b/src/snapshots/likewise__udiff__unified_diff_newline_hint-2.snap similarity index 57% rename from src/snapshots/similar__udiff__unified_diff_newline_hint-2.snap rename to src/snapshots/likewise__udiff__unified_diff_newline_hint-2.snap index 9a5d922..a189752 100644 --- a/src/snapshots/similar__udiff__unified_diff_newline_hint-2.snap +++ b/src/snapshots/likewise__udiff__unified_diff_newline_hint-2.snap @@ -1,10 +1,9 @@ --- source: src/udiff.rs -expression: "&diff.unified_diff().missing_newline_hint(false).header(\"a.txt\",\n \"b.txt\").to_string()" +expression: "&diff.unified_diff().missing_newline_hint(false).header(\"a.txt\",\n\"b.txt\").to_string()" --- --- a.txt +++ b.txt @@ -1 +1 @@ -a +b - diff --git a/src/snapshots/similar__udiff__unified_diff_newline_hint.snap b/src/snapshots/likewise__udiff__unified_diff_newline_hint.snap similarity index 99% rename from src/snapshots/similar__udiff__unified_diff_newline_hint.snap rename to src/snapshots/likewise__udiff__unified_diff_newline_hint.snap index d181b28..928b811 100644 --- a/src/snapshots/similar__udiff__unified_diff_newline_hint.snap +++ b/src/snapshots/likewise__udiff__unified_diff_newline_hint.snap @@ -8,4 +8,3 @@ expression: "&diff.unified_diff().header(\"a.txt\", \"b.txt\").to_string()" -a +b \ No newline at end of file - diff --git a/src/text/mod.rs b/src/text/mod.rs index f61a237..c724fae 100644 --- a/src/text/mod.rs +++ b/src/text/mod.rs @@ -93,7 +93,7 @@ impl TextDiffConfig { /// influence the behavior of unified diff generation. /// /// ```rust - /// use similar::{TextDiff, ChangeTag}; + /// use likewise::{TextDiff, ChangeTag}; /// /// let diff = TextDiff::configure().diff_lines("a\nb\nc", "a\nb\nC"); /// let changes: Vec<_> = diff @@ -131,7 +131,7 @@ impl TextDiffConfig { /// which lets you remap the diffs back to the original input strings. /// /// ```rust - /// use similar::{TextDiff, ChangeTag}; + /// use likewise::{TextDiff, ChangeTag}; /// /// let diff = TextDiff::configure().diff_words("foo bar baz", "foo BAR baz"); /// let changes: Vec<_> = diff @@ -169,7 +169,7 @@ impl TextDiffConfig { /// which lets you remap the diffs back to the original input strings. /// /// ```rust - /// use similar::{TextDiff, ChangeTag}; + /// use likewise::{TextDiff, ChangeTag}; /// /// let diff = TextDiff::configure().diff_chars("abcdef", "abcDDf"); /// let changes: Vec<_> = diff @@ -215,7 +215,7 @@ impl TextDiffConfig { /// which lets you remap the diffs back to the original input strings. /// /// ```rust - /// use similar::{TextDiff, ChangeTag}; + /// use likewise::{TextDiff, ChangeTag}; /// /// let diff = TextDiff::configure().diff_unicode_words("ah(be)ce", "ah(ah)ce"); /// let changes: Vec<_> = diff @@ -256,7 +256,7 @@ impl TextDiffConfig { /// which lets you remap the diffs back to the original input strings. /// /// ```rust - /// use similar::{TextDiff, ChangeTag}; + /// use likewise::{TextDiff, ChangeTag}; /// /// let diff = TextDiff::configure().diff_graphemes("💩🇦🇹🦠", "💩🇦🇱❄️"); /// let changes: Vec<_> = diff @@ -288,7 +288,7 @@ impl TextDiffConfig { /// Creates a diff of arbitrary slices. /// /// ```rust - /// use similar::{TextDiff, ChangeTag}; + /// use likewise::{TextDiff, ChangeTag}; /// /// let old = &["foo", "bar", "baz"]; /// let new = &["foo", "BAR", "baz"]; @@ -469,7 +469,7 @@ impl<'old, 'new, 'bufs, T: DiffableStr + ?Sized + 'old + 'new> TextDiff<'old, 'n /// ratio of `0.0` would indicate completely distinct sequences. /// /// ```rust - /// # use similar::TextDiff; + /// # use likewise::TextDiff; /// let diff = TextDiff::from_chars("abcd", "bcde"); /// assert_eq!(diff.ratio(), 0.75); /// ``` @@ -575,7 +575,7 @@ impl<'old, 'new, 'bufs, T: DiffableStr + ?Sized + 'old + 'new> TextDiff<'old, 'n /// to be considered similar. See [`TextDiff::ratio`] for more information. /// /// ``` -/// # use similar::get_close_matches; +/// # use likewise::get_close_matches; /// let matches = get_close_matches( /// "appel", /// &["ape", "apple", "peach", "puppy"][..], diff --git a/src/text/snapshots/similar__text__captured_ops.snap b/src/text/snapshots/likewise__text__captured_ops.snap similarity index 100% rename from src/text/snapshots/similar__text__captured_ops.snap rename to src/text/snapshots/likewise__text__captured_ops.snap diff --git a/src/text/snapshots/similar__text__captured_word_ops.snap b/src/text/snapshots/likewise__text__captured_word_ops.snap similarity index 100% rename from src/text/snapshots/similar__text__captured_word_ops.snap rename to src/text/snapshots/likewise__text__captured_word_ops.snap diff --git a/src/text/snapshots/similar__text__char_diff.snap b/src/text/snapshots/likewise__text__char_diff.snap similarity index 100% rename from src/text/snapshots/similar__text__char_diff.snap rename to src/text/snapshots/likewise__text__char_diff.snap diff --git a/src/text/snapshots/similar__text__lifetimes_on_iter.snap b/src/text/snapshots/likewise__text__lifetimes_on_iter.snap similarity index 100% rename from src/text/snapshots/similar__text__lifetimes_on_iter.snap rename to src/text/snapshots/likewise__text__lifetimes_on_iter.snap diff --git a/src/text/snapshots/similar__text__line_ops.snap b/src/text/snapshots/likewise__text__line_ops.snap similarity index 100% rename from src/text/snapshots/similar__text__line_ops.snap rename to src/text/snapshots/likewise__text__line_ops.snap diff --git a/src/text/snapshots/similar__text__unified_diff.snap b/src/text/snapshots/likewise__text__unified_diff.snap similarity index 99% rename from src/text/snapshots/similar__text__unified_diff.snap rename to src/text/snapshots/likewise__text__unified_diff.snap index 77f409a..acee570 100644 --- a/src/text/snapshots/similar__text__unified_diff.snap +++ b/src/text/snapshots/likewise__text__unified_diff.snap @@ -9,4 +9,3 @@ expression: "&diff.unified_diff().context_radius(3).header(\"old\", \"new\").to_ -some stuff here +some amazing stuff here some more stuff here - diff --git a/src/text/snapshots/similar__text__virtual_newlines.snap b/src/text/snapshots/likewise__text__virtual_newlines.snap similarity index 100% rename from src/text/snapshots/similar__text__virtual_newlines.snap rename to src/text/snapshots/likewise__text__virtual_newlines.snap diff --git a/src/text/snapshots/similar__text__inline__line_ops_inline.snap b/src/text/snapshots/similar__text__inline__line_ops_inline.snap deleted file mode 100644 index 2133460..0000000 --- a/src/text/snapshots/similar__text__inline__line_ops_inline.snap +++ /dev/null @@ -1,126 +0,0 @@ ---- -source: src/text/inline.rs -expression: "&changes" ---- -[ - InlineChange { - tag: Insert, - old_index: None, - new_index: Some( - 0, - ), - values: [ - ( - false, - "Stuff\n", - ), - ], - }, - InlineChange { - tag: Equal, - old_index: Some( - 0, - ), - new_index: Some( - 1, - ), - values: [ - ( - false, - "Hello World\n", - ), - ], - }, - InlineChange { - tag: Delete, - old_index: Some( - 1, - ), - new_index: None, - values: [ - ( - false, - "some ", - ), - ( - false, - "stuff here\n", - ), - ], - }, - InlineChange { - tag: Insert, - old_index: None, - new_index: Some( - 2, - ), - values: [ - ( - false, - "some ", - ), - ( - true, - "amazing ", - ), - ( - false, - "stuff here\n", - ), - ], - }, - InlineChange { - tag: Equal, - old_index: Some( - 2, - ), - new_index: Some( - 3, - ), - values: [ - ( - false, - "some more stuff here\n", - ), - ], - }, - InlineChange { - tag: Delete, - old_index: Some( - 3, - ), - new_index: None, - values: [ - ( - false, - "\n", - ), - ], - }, - InlineChange { - tag: Delete, - old_index: Some( - 4, - ), - new_index: None, - values: [ - ( - false, - "Aha stuff here\n", - ), - ], - }, - InlineChange { - tag: Delete, - old_index: Some( - 5, - ), - new_index: None, - values: [ - ( - false, - "and more stuff", - ), - ], - }, -] diff --git a/src/text/snapshots/similar__text__inline__serde.snap b/src/text/snapshots/similar__text__inline__serde.snap deleted file mode 100644 index 44ab829..0000000 --- a/src/text/snapshots/similar__text__inline__serde.snap +++ /dev/null @@ -1,107 +0,0 @@ ---- -source: src/text/inline.rs -expression: "&json" - ---- -[ - { - "tag": "insert", - "old_index": null, - "new_index": 0, - "values": [ - [ - false, - "Stuff\n" - ] - ] - }, - { - "tag": "equal", - "old_index": 0, - "new_index": 1, - "values": [ - [ - false, - "Hello World\n" - ] - ] - }, - { - "tag": "delete", - "old_index": 1, - "new_index": null, - "values": [ - [ - false, - "some " - ], - [ - false, - "stuff here\n" - ] - ] - }, - { - "tag": "insert", - "old_index": null, - "new_index": 2, - "values": [ - [ - false, - "some " - ], - [ - true, - "amazing " - ], - [ - false, - "stuff here\n" - ] - ] - }, - { - "tag": "equal", - "old_index": 2, - "new_index": 3, - "values": [ - [ - false, - "some more stuff here\n" - ] - ] - }, - { - "tag": "delete", - "old_index": 3, - "new_index": null, - "values": [ - [ - false, - "\n" - ] - ] - }, - { - "tag": "delete", - "old_index": 4, - "new_index": null, - "values": [ - [ - false, - "Aha stuff here\n" - ] - ] - }, - { - "tag": "delete", - "old_index": 5, - "new_index": null, - "values": [ - [ - false, - "and more stuff" - ] - ] - } -] diff --git a/src/text/snapshots/similar__text__serde.snap b/src/text/snapshots/similar__text__serde.snap deleted file mode 100644 index 13418a6..0000000 --- a/src/text/snapshots/similar__text__serde.snap +++ /dev/null @@ -1,55 +0,0 @@ ---- -source: src/text/mod.rs -expression: "&json" - ---- -[ - { - "tag": "insert", - "old_index": null, - "new_index": 0, - "value": "Stuff\n" - }, - { - "tag": "equal", - "old_index": 0, - "new_index": 1, - "value": "Hello World\n" - }, - { - "tag": "delete", - "old_index": 1, - "new_index": null, - "value": "some stuff here\n" - }, - { - "tag": "insert", - "old_index": null, - "new_index": 2, - "value": "some amazing stuff here\n" - }, - { - "tag": "equal", - "old_index": 2, - "new_index": 3, - "value": "some more stuff here\n" - }, - { - "tag": "delete", - "old_index": 3, - "new_index": null, - "value": "\n" - }, - { - "tag": "delete", - "old_index": 4, - "new_index": null, - "value": "Aha stuff here\n" - }, - { - "tag": "delete", - "old_index": 5, - "new_index": null, - "value": "and more stuff" - } -] diff --git a/src/text/snapshots/similar__text__serde_ops.snap b/src/text/snapshots/similar__text__serde_ops.snap deleted file mode 100644 index 040fe97..0000000 --- a/src/text/snapshots/similar__text__serde_ops.snap +++ /dev/null @@ -1,38 +0,0 @@ ---- -source: src/text/mod.rs -expression: "&json" - ---- -[ - { - "op": "insert", - "old_index": 0, - "new_index": 0, - "new_len": 1 - }, - { - "op": "equal", - "old_index": 0, - "new_index": 1, - "len": 1 - }, - { - "op": "replace", - "old_index": 1, - "old_len": 1, - "new_index": 2, - "new_len": 1 - }, - { - "op": "equal", - "old_index": 2, - "new_index": 3, - "len": 1 - }, - { - "op": "delete", - "old_index": 3, - "old_len": 3, - "new_index": 4 - } -] diff --git a/src/types.rs b/src/types.rs index 4399a68..4a5c8b9 100644 --- a/src/types.rs +++ b/src/types.rs @@ -284,8 +284,8 @@ impl DiffOp { /// the diffing algorithm functions. /// /// ```rust - /// use similar::{ChangeTag, Algorithm}; - /// use similar::capture_diff_slices; + /// use likewise::{ChangeTag, Algorithm}; + /// use likewise::capture_diff_slices; /// let old = vec!["foo", "bar", "baz"]; /// let new = vec!["foo", "bar", "blah"]; /// let ops = capture_diff_slices(Algorithm::Myers, &old, &new); @@ -322,8 +322,8 @@ impl DiffOp { /// [`DiffOp::Replace`] operation is passed. /// /// ```rust - /// use similar::{ChangeTag, Algorithm}; - /// use similar::capture_diff_slices; + /// use likewise::{ChangeTag, Algorithm}; + /// use likewise::capture_diff_slices; /// let old = vec!["foo", "bar", "baz"]; /// let new = vec!["foo", "bar", "blah"]; /// let ops = capture_diff_slices(Algorithm::Myers, &old, &new); diff --git a/src/udiff.rs b/src/udiff.rs index 26701da..f7de91d 100644 --- a/src/udiff.rs +++ b/src/udiff.rs @@ -4,7 +4,7 @@ //! is enabled by default: //! //! ```rust -//! use similar::TextDiff; +//! use likewise::TextDiff; //! # let old_text = ""; //! # let new_text = ""; //! let text_diff = TextDiff::from_lines(old_text, new_text); @@ -101,7 +101,7 @@ impl fmt::Display for UnifiedHunkHeader { /// Unified diff formatter. /// /// ```rust -/// use similar::TextDiff; +/// use likewise::TextDiff; /// # let old_text = ""; /// # let new_text = ""; /// let text_diff = TextDiff::from_lines(old_text, new_text); diff --git a/src/utils.rs b/src/utils.rs index 7b2cdb3..8b68753 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -76,8 +76,8 @@ impl Index> for SliceRemapper<'_, T> { /// but large consequitive ones from the source. /// /// ```rust -/// use similar::{ChangeTag, TextDiff}; -/// use similar::utils::TextDiffRemapper; +/// use likewise::{ChangeTag, TextDiff}; +/// use likewise::utils::TextDiffRemapper; /// /// let old = "yo! foo bar baz"; /// let new = "yo! foo bor baz"; @@ -198,8 +198,8 @@ impl<'x, T: DiffableStr + ?Sized> TextDiffRemapper<'x, T> { /// with the changes. /// /// ```rust -/// use similar::{Algorithm, ChangeTag}; -/// use similar::utils::diff_slices; +/// use likewise::{Algorithm, ChangeTag}; +/// use likewise::utils::diff_slices; /// /// let old = "foo\nbar\nbaz".lines().collect::>(); /// let new = "foo\nbar\nBAZ".lines().collect::>(); @@ -227,8 +227,8 @@ pub fn diff_slices<'x, T: PartialEq + Hash + Ord>( /// rather than character level slices. /// /// ```rust -/// use similar::{Algorithm, ChangeTag}; -/// use similar::utils::diff_chars; +/// use likewise::{Algorithm, ChangeTag}; +/// use likewise::utils::diff_chars; /// /// assert_eq!(diff_chars(Algorithm::Myers, "foobarbaz", "fooBARbaz"), vec![ /// (ChangeTag::Equal, "foo"), @@ -259,8 +259,8 @@ pub fn diff_chars<'x, T: DiffableStrRef + ?Sized>( /// rather than word level slices. /// /// ```rust -/// use similar::{Algorithm, ChangeTag}; -/// use similar::utils::diff_words; +/// use likewise::{Algorithm, ChangeTag}; +/// use likewise::utils::diff_words; /// /// assert_eq!(diff_words(Algorithm::Myers, "foo bar baz", "foo bor baz"), vec![ /// (ChangeTag::Equal, "foo "), @@ -291,8 +291,8 @@ pub fn diff_words<'x, T: DiffableStrRef + ?Sized>( /// rather than word level slices. /// /// ```rust -/// use similar::{Algorithm, ChangeTag}; -/// use similar::utils::diff_unicode_words; +/// use likewise::{Algorithm, ChangeTag}; +/// use likewise::utils::diff_unicode_words; /// /// let old = "The quick (\"brown\") fox can't jump 32.3 feet, right?"; /// let new = "The quick (\"brown\") fox can't jump 9.84 meters, right?"; @@ -333,8 +333,8 @@ pub fn diff_unicode_words<'x, T: DiffableStrRef + ?Sized>( /// rather than grapheme level slices. /// /// ```rust -/// use similar::{Algorithm, ChangeTag}; -/// use similar::utils::diff_graphemes; +/// use likewise::{Algorithm, ChangeTag}; +/// use likewise::utils::diff_graphemes; /// /// let old = "The flag of Austria is 🇦🇹"; /// let new = "The flag of Albania is 🇦🇱"; @@ -374,8 +374,8 @@ pub fn diff_graphemes<'x, T: DiffableStrRef + ?Sized>( /// change tag for each line. /// /// ```rust -/// use similar::{Algorithm, ChangeTag}; -/// use similar::utils::diff_lines; +/// use likewise::{Algorithm, ChangeTag}; +/// use likewise::utils::diff_lines; /// /// assert_eq!(diff_lines(Algorithm::Myers, "foo\nbar\nbaz\nblah", "foo\nbar\nbaz\nblurgh"), vec![ /// (ChangeTag::Equal, "foo\n"), From 8e295e06e1aa924066f90ca56c68ae89565820b8 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 11 Sep 2025 13:32:42 -0500 Subject: [PATCH 02/18] bump version to 3 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index d6e5ff4..63ac58c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "likewise" -version = "2.7.0" +version = "3.0.0" authors = [ "Barrett Ruth ", "Armin Ronacher ", From 0fb164d310c40ec973f135b20a5423bfc0642613 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 11 Sep 2025 13:52:48 -0500 Subject: [PATCH 03/18] feat: other snapshots and ci --- .github/workflows/ci.yml | 95 ++++++++++++++++ .../likewise__text__inline__serde.snap | 106 ++++++++++++++++++ src/text/snapshots/likewise__text__serde.snap | 54 +++++++++ .../snapshots/likewise__text__serde_ops.snap | 37 ++++++ 4 files changed, 292 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 src/text/snapshots/likewise__text__inline__serde.snap create mode 100644 src/text/snapshots/likewise__text__serde.snap create mode 100644 src/text/snapshots/likewise__text__serde_ops.snap diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..bb38b64 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,95 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: Test Suite + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - stable + - beta + - 1.60.0 # MSRV from Cargo.toml + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + - uses: Swatinem/rust-cache@v2 + - name: Run tests + run: cargo test --verbose + - name: Run tests with all features + run: cargo test --all-features --verbose + + feature-tests: + name: Feature Tests + runs-on: ubuntu-latest + strategy: + matrix: + features: + - "text" + - "unicode" + - "bytes" + - "inline" + - "serde" + - "text,unicode" + - "text,bytes" + - "text,inline" + - "text,serde" + - "text,unicode,bytes" + - "text,unicode,inline" + - "text,unicode,serde" + - "text,bytes,inline" + - "text,bytes,serde" + - "text,inline,serde" + - "unicode,bytes,inline,serde" + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - name: Test with features ${{ matrix.features }} + run: cargo test --features ${{ matrix.features }} --verbose + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy + - uses: Swatinem/rust-cache@v2 + - name: Run clippy + run: cargo clippy --all-targets --all-features -- -D warnings + + fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + - name: Run rustfmt + run: cargo fmt --all -- --check + + docs: + name: Docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - name: Check documentation + run: cargo doc --all-features --no-deps --document-private-items + env: + RUSTDOCFLAGS: -D warnings diff --git a/src/text/snapshots/likewise__text__inline__serde.snap b/src/text/snapshots/likewise__text__inline__serde.snap new file mode 100644 index 0000000..11b50d3 --- /dev/null +++ b/src/text/snapshots/likewise__text__inline__serde.snap @@ -0,0 +1,106 @@ +--- +source: src/text/inline.rs +expression: "&json" +--- +[ + { + "tag": "insert", + "old_index": null, + "new_index": 0, + "values": [ + [ + false, + "Stuff\n" + ] + ] + }, + { + "tag": "equal", + "old_index": 0, + "new_index": 1, + "values": [ + [ + false, + "Hello World\n" + ] + ] + }, + { + "tag": "delete", + "old_index": 1, + "new_index": null, + "values": [ + [ + false, + "some " + ], + [ + false, + "stuff here\n" + ] + ] + }, + { + "tag": "insert", + "old_index": null, + "new_index": 2, + "values": [ + [ + false, + "some " + ], + [ + true, + "amazing " + ], + [ + false, + "stuff here\n" + ] + ] + }, + { + "tag": "equal", + "old_index": 2, + "new_index": 3, + "values": [ + [ + false, + "some more stuff here\n" + ] + ] + }, + { + "tag": "delete", + "old_index": 3, + "new_index": null, + "values": [ + [ + false, + "\n" + ] + ] + }, + { + "tag": "delete", + "old_index": 4, + "new_index": null, + "values": [ + [ + false, + "Aha stuff here\n" + ] + ] + }, + { + "tag": "delete", + "old_index": 5, + "new_index": null, + "values": [ + [ + false, + "and more stuff" + ] + ] + } +] diff --git a/src/text/snapshots/likewise__text__serde.snap b/src/text/snapshots/likewise__text__serde.snap new file mode 100644 index 0000000..802fdf8 --- /dev/null +++ b/src/text/snapshots/likewise__text__serde.snap @@ -0,0 +1,54 @@ +--- +source: src/text/mod.rs +expression: "&json" +--- +[ + { + "tag": "insert", + "old_index": null, + "new_index": 0, + "value": "Stuff\n" + }, + { + "tag": "equal", + "old_index": 0, + "new_index": 1, + "value": "Hello World\n" + }, + { + "tag": "delete", + "old_index": 1, + "new_index": null, + "value": "some stuff here\n" + }, + { + "tag": "insert", + "old_index": null, + "new_index": 2, + "value": "some amazing stuff here\n" + }, + { + "tag": "equal", + "old_index": 2, + "new_index": 3, + "value": "some more stuff here\n" + }, + { + "tag": "delete", + "old_index": 3, + "new_index": null, + "value": "\n" + }, + { + "tag": "delete", + "old_index": 4, + "new_index": null, + "value": "Aha stuff here\n" + }, + { + "tag": "delete", + "old_index": 5, + "new_index": null, + "value": "and more stuff" + } +] diff --git a/src/text/snapshots/likewise__text__serde_ops.snap b/src/text/snapshots/likewise__text__serde_ops.snap new file mode 100644 index 0000000..25b244c --- /dev/null +++ b/src/text/snapshots/likewise__text__serde_ops.snap @@ -0,0 +1,37 @@ +--- +source: src/text/mod.rs +expression: "&json" +--- +[ + { + "op": "insert", + "old_index": 0, + "new_index": 0, + "new_len": 1 + }, + { + "op": "equal", + "old_index": 0, + "new_index": 1, + "len": 1 + }, + { + "op": "replace", + "old_index": 1, + "old_len": 1, + "new_index": 2, + "new_len": 1 + }, + { + "op": "equal", + "old_index": 2, + "new_index": 3, + "len": 1 + }, + { + "op": "delete", + "old_index": 3, + "old_len": 3, + "new_index": 4 + } +] From 2f13fe1c8d5a8d9b3e646b68528b1867b247b26d Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 11 Sep 2025 13:54:55 -0500 Subject: [PATCH 04/18] update ci --- .github/workflows/ci.yml | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb38b64..00dc317 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,18 +59,6 @@ jobs: - name: Test with features ${{ matrix.features }} run: cargo test --features ${{ matrix.features }} --verbose - clippy: - name: Clippy - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - with: - components: clippy - - uses: Swatinem/rust-cache@v2 - - name: Run clippy - run: cargo clippy --all-targets --all-features -- -D warnings - fmt: name: Rustfmt runs-on: ubuntu-latest @@ -81,15 +69,3 @@ jobs: components: rustfmt - name: Run rustfmt run: cargo fmt --all -- --check - - docs: - name: Docs - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - name: Check documentation - run: cargo doc --all-features --no-deps --document-private-items - env: - RUSTDOCFLAGS: -D warnings From 631826d4e976fff5d50fd2ba7a08524ef7c9f69a Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 11 Sep 2025 13:57:30 -0500 Subject: [PATCH 05/18] more snapshots --- ...kewise__text__inline__line_ops_inline.snap | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 src/text/snapshots/likewise__text__inline__line_ops_inline.snap diff --git a/src/text/snapshots/likewise__text__inline__line_ops_inline.snap b/src/text/snapshots/likewise__text__inline__line_ops_inline.snap new file mode 100644 index 0000000..2133460 --- /dev/null +++ b/src/text/snapshots/likewise__text__inline__line_ops_inline.snap @@ -0,0 +1,126 @@ +--- +source: src/text/inline.rs +expression: "&changes" +--- +[ + InlineChange { + tag: Insert, + old_index: None, + new_index: Some( + 0, + ), + values: [ + ( + false, + "Stuff\n", + ), + ], + }, + InlineChange { + tag: Equal, + old_index: Some( + 0, + ), + new_index: Some( + 1, + ), + values: [ + ( + false, + "Hello World\n", + ), + ], + }, + InlineChange { + tag: Delete, + old_index: Some( + 1, + ), + new_index: None, + values: [ + ( + false, + "some ", + ), + ( + false, + "stuff here\n", + ), + ], + }, + InlineChange { + tag: Insert, + old_index: None, + new_index: Some( + 2, + ), + values: [ + ( + false, + "some ", + ), + ( + true, + "amazing ", + ), + ( + false, + "stuff here\n", + ), + ], + }, + InlineChange { + tag: Equal, + old_index: Some( + 2, + ), + new_index: Some( + 3, + ), + values: [ + ( + false, + "some more stuff here\n", + ), + ], + }, + InlineChange { + tag: Delete, + old_index: Some( + 3, + ), + new_index: None, + values: [ + ( + false, + "\n", + ), + ], + }, + InlineChange { + tag: Delete, + old_index: Some( + 4, + ), + new_index: None, + values: [ + ( + false, + "Aha stuff here\n", + ), + ], + }, + InlineChange { + tag: Delete, + old_index: Some( + 5, + ), + new_index: None, + values: [ + ( + false, + "and more stuff", + ), + ], + }, +] From 14a3a080956cf96571f075437014a4eec510f58d Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 11 Sep 2025 14:01:25 -0500 Subject: [PATCH 06/18] use compatible insta version, oops --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 63ac58c..37afbaa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ unicode = ["text", "unicode-segmentation", "bstr?/unicode", "bstr?/std"] bytes = ["bstr", "text"] [dev-dependencies] -insta = "1.10.0" +insta = "=1.10.0" console = "0.15.0" serde_json = "1.0.68" From c788da2db6aefa51004e06cce68b06d193eea9a1 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 11 Sep 2025 14:04:33 -0500 Subject: [PATCH 07/18] update msrv --- Cargo.lock.msrv | 302 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 224 insertions(+), 78 deletions(-) diff --git a/Cargo.lock.msrv b/Cargo.lock.msrv index bd28535..749769b 100644 --- a/Cargo.lock.msrv +++ b/Cargo.lock.msrv @@ -3,66 +3,124 @@ version = 3 [[package]] -name = "bstr" +name = "autocfg" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a246e68bb43f6cd9db24bea052a53e40405417c5fb372e3d1a8a7f770a564ef5" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "bstr" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234113d19d0d7d613b40e86fb654acf958910802bcceab913a4f9e7cda03b1a4" dependencies = [ "memchr", - "once_cell", "regex-automata", "serde", ] [[package]] -name = "console" -version = "0.15.7" +name = "bumpalo" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" + +[[package]] +name = "cfg-if" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" + +[[package]] +name = "console" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" dependencies = [ "encode_unicode", - "lazy_static", "libc", + "once_cell", "unicode-width", "windows-sys", ] [[package]] name = "encode_unicode" -version = "0.3.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", +] [[package]] name = "insta" -version = "1.31.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0770b0a3d4c70567f0d58331f3088b0e4c4f56c9b8d764efe654b4a5d46de3a" +checksum = "b3cb858fc306825b542b1311d5fd536e4483680528f303a17a1d6803b0f6ce17" dependencies = [ "console", "lazy_static", - "linked-hash-map", - "similar 2.2.1", - "yaml-rust", + "serde", + "serde_json", + "serde_yaml", + "similar", + "uuid", ] [[package]] name = "itoa" -version = "0.4.8" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0b063578492ceec17683ef2f8c5e89121fbd0b172cbc280635ab7567db2738" +dependencies = [ + "once_cell", + "wasm-bindgen", +] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.175" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" + +[[package]] +name = "likewise" +version = "3.0.0" +dependencies = [ + "bstr", + "console", + "insta", + "serde", + "serde_json", + "unicode-segmentation", + "web-time", +] [[package]] name = "linked-hash-map" @@ -71,61 +129,67 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] -name = "memchr" -version = "2.6.0" +name = "log" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76fc44e2588d5b436dbc3c6cf62aef290f90dab6235744a93dfe1cc18f451e2c" +checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "once_cell" -version = "1.19.0" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "proc-macro2" -version = "1.0.46" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.20" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] [[package]] name = "regex-automata" -version = "0.1.10" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6" [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "serde" -version = "1.0.130" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.130" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", @@ -134,38 +198,39 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.68" +version = "1.0.143" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8" +checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] -name = "similar" -version = "2.2.1" +name = "serde_yaml" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" - -[[package]] -name = "similar" -version = "2.5.0" +checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" dependencies = [ - "bstr", - "console", - "insta", + "indexmap", + "ryu", "serde", - "serde_json", - "unicode-segmentation", + "yaml-rust", ] [[package]] -name = "syn" -version = "1.0.109" +name = "similar" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" + +[[package]] +name = "syn" +version = "2.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" dependencies = [ "proc-macro2", "quote", @@ -174,40 +239,115 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" [[package]] name = "unicode-segmentation" -version = "1.10.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" + +[[package]] +name = "wasm-bindgen" +version = "0.2.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e14915cadd45b529bb8d1f343c4ed0ac1de926144b746e2710f9cd05df6603b" +dependencies = [ + "cfg-if", + "once_cell", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28d1ba982ca7923fd01448d5c30c6864d0a14109560296a162f80f305fb93bb" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c3d463ae3eff775b0c45df9da45d68837702ac35af998361e2c84e7c5ec1b0d" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bb4ce89b08211f923caf51d527662b75bdc9c9c7aab40f86dcb9fb85ac552aa" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f143854a3b13752c6950862c906306adb27c7e839f7414cec8fea35beab624c1" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] [[package]] name = "windows-sys" -version = "0.45.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" -version = "0.42.2" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", "windows_i686_gnu", + "windows_i686_gnullvm", "windows_i686_msvc", "windows_x86_64_gnu", "windows_x86_64_gnullvm", @@ -216,45 +356,51 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.2" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" -version = "0.42.2" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.42.2" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" -version = "0.42.2" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" -version = "0.42.2" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.2" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" -version = "0.42.2" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "yaml-rust" From 3132d901cb2380e5e3da90cfe991e68efd10f1dd Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 11 Sep 2025 14:06:48 -0500 Subject: [PATCH 08/18] sorryt 1.6 --- .github/workflows/ci.yml | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00dc317..5f352ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: rust: - stable - beta - - 1.60.0 # MSRV from Cargo.toml + - 1.63.0 # MSRV from Cargo.toml steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master diff --git a/Cargo.toml b/Cargo.toml index 37afbaa..bce7216 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ authors = [ "Brandon Williams ", ] edition = "2018" -rust-version = "1.60" +rust-version = "1.63" license = "Apache-2.0" description = "A diff library for Rust (fork of similar)" repository = "https://github.com/barrett-ruth/likewise" From 96ce871e550fd12c380f021e007be6272e1283c8 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 11 Sep 2025 14:08:10 -0500 Subject: [PATCH 09/18] fix the backtracke --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index bce7216..54728fc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ unicode = ["text", "unicode-segmentation", "bstr?/unicode", "bstr?/std"] bytes = ["bstr", "text"] [dev-dependencies] -insta = "=1.10.0" +insta = { version = "=1.10.0", features = ["backtrace"] } console = "0.15.0" serde_json = "1.0.68" From 700fd26030ce005e008732e16b17fa82c230ee84 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 11 Sep 2025 14:08:20 -0500 Subject: [PATCH 10/18] regen msrv --- Cargo.lock.msrv | 61 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/Cargo.lock.msrv b/Cargo.lock.msrv index 749769b..37d19b2 100644 --- a/Cargo.lock.msrv +++ b/Cargo.lock.msrv @@ -2,12 +2,42 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + [[package]] name = "autocfg" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +[[package]] +name = "backtrace" +version = "0.3.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets", +] + [[package]] name = "bstr" version = "1.12.0" @@ -50,6 +80,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + [[package]] name = "hashbrown" version = "0.12.3" @@ -72,6 +108,7 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3cb858fc306825b542b1311d5fd536e4483680528f303a17a1d6803b0f6ce17" dependencies = [ + "backtrace", "console", "lazy_static", "serde", @@ -140,6 +177,24 @@ version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.21.3" @@ -170,6 +225,12 @@ version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6" +[[package]] +name = "rustc-demangle" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" + [[package]] name = "ryu" version = "1.0.20" From 93938ccfc23dcd981bbf61c1d598fa3e8e77b96a Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 11 Sep 2025 14:12:09 -0500 Subject: [PATCH 11/18] update to 1.65 --- .github/workflows/ci.yml | 2 +- CHANGELOG.md | 132 --------------------------------------- Cargo.toml | 2 +- README.md | 2 +- clippy.toml | 2 +- 5 files changed, 4 insertions(+), 136 deletions(-) delete mode 100644 CHANGELOG.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f352ae..5c8a734 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: rust: - stable - beta - - 1.63.0 # MSRV from Cargo.toml + - 1.65.0 # MSRV from Cargo.toml steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index be24632..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,132 +0,0 @@ -# Changelog - -All notable changes to similar are documented here. - -## 2.7.0 - -* 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 - -## 2.6.0 - -* Bump bstr dependency to 1.5. #69 - -## 2.5.0 - -* Added support for `TextDiff::iter_inline_changes_deadline`. #61 -* Raise MSRV to 1.60. #62 -* Bump bstr dependency to 1.0. #62 - -## 2.4.0 - -* 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) - -## 2.3.0 - -* Added support for `Change::value_ref` and `Change::value_mut`. - -## 2.2.1 - -* Fixed a panic in LCS diffs on matching input. (#43) - -## 2.2.0 - -* Fixed a panic in text diff generation. (#37) - -## 2.1.0 - -* Removed deprecated alternative slice diffing functions. -* Added `serde` feature to allow serialization with serde. - -## 2.0.0 - -* 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. - -## 1.3.0 - -* 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. - -## 1.2.2 - -* Added support for Rust 1.41.0 for better compatibility. - -## 1.2.1 - -* Added support for Rust 1.43.0 for better compatibility. - -## 1.2.0 - -* 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. - -## 1.1.0 - -* 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. - -## 1.0.0 - -* 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. - -## 0.5.0 - -* 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`). - -## 0.4.0 - -* Change `get_close_matches` to use Python's quick ratio optimization - and order lexicographically when tied. - -## 0.3.0 - -* 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`. - -## 0.2.0 - -* Fixed a bug in the patience algorithm causing it not not work. - -## 0.1.0 - -* Initial release. diff --git a/Cargo.toml b/Cargo.toml index 54728fc..36a580d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ authors = [ "Brandon Williams ", ] edition = "2018" -rust-version = "1.63" +rust-version = "1.65" license = "Apache-2.0" description = "A diff library for Rust (fork of similar)" repository = "https://github.com/barrett-ruth/likewise" diff --git a/README.md b/README.md index 61dc646..5b5e4ef 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Crates.io](https://img.shields.io/crates/d/likewise.svg)](https://crates.io/crates/likewise) [![License](https://img.shields.io/github/license/frozen/likewise)](https://github.com/frozen/likewise/blob/main/LICENSE) -[![rustc 1.60.0](https://img.shields.io/badge/rust-1.60%2B-orange.svg)](https://img.shields.io/badge/rust-1.60%2B-orange.svg) +[![rustc 1.65.0](https://img.shields.io/badge/rust-1.60%2B-orange.svg)](https://img.shields.io/badge/rust-1.65%2B-orange.svg) [![Documentation](https://docs.rs/likewise/badge.svg)](https://docs.rs/likewise) Likewise is a dependency free crate for Rust that implements different diffing diff --git a/clippy.toml b/clippy.toml index 16caf02..e034672 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1 @@ -msrv = "1.60.0" +msrv = "1.65.0" From cdd0f7b3c5988eebb3a590932664b243c25988f2 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 11 Sep 2025 14:18:49 -0500 Subject: [PATCH 12/18] update ci --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c8a734..42122ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,9 @@ jobs: with: toolchain: ${{ matrix.rust }} - uses: Swatinem/rust-cache@v2 + - name: Use MSRV lockfile for minimum version testing + if: matrix.rust == '1.65.0' + run: cp Cargo.lock.msrv Cargo.lock - name: Run tests run: cargo test --verbose - name: Run tests with all features From 7d5395a30c8a33835c0da9a33ef347eff298e4c8 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 11 Sep 2025 14:24:53 -0500 Subject: [PATCH 13/18] update --- Cargo.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 36a580d..c9dea56 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ unicode = ["text", "unicode-segmentation", "bstr?/unicode", "bstr?/std"] bytes = ["bstr", "text"] [dev-dependencies] -insta = { version = "=1.10.0", features = ["backtrace"] } +insta = "=1.21.0" console = "0.15.0" serde_json = "1.0.68" @@ -72,3 +72,6 @@ required-features = ["text", "serde"] [profile.release] debug = true + +[profile.test] +debug = true From 3c26bd1f6121e9efc744003eb6538c977de9faba Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 11 Sep 2025 14:42:44 -0500 Subject: [PATCH 14/18] version to 1.66 --- Cargo.lock.msrv | 111 ++---------------------------------------------- Cargo.toml | 5 +-- clippy.toml | 2 +- 3 files changed, 6 insertions(+), 112 deletions(-) diff --git a/Cargo.lock.msrv b/Cargo.lock.msrv index 37d19b2..dceef63 100644 --- a/Cargo.lock.msrv +++ b/Cargo.lock.msrv @@ -2,42 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "addr2line" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" - -[[package]] -name = "autocfg" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" - -[[package]] -name = "backtrace" -version = "0.3.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets", -] - [[package]] name = "bstr" version = "1.12.0" @@ -80,42 +44,17 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown", -] - [[package]] name = "insta" -version = "1.10.0" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3cb858fc306825b542b1311d5fd536e4483680528f303a17a1d6803b0f6ce17" +checksum = "581d4e3314cae4536e5d22ffd23189d4a374696c5ef733eadafae0ed273fd303" dependencies = [ - "backtrace", "console", "lazy_static", - "serde", - "serde_json", - "serde_yaml", + "linked-hash-map", "similar", - "uuid", + "yaml-rust", ] [[package]] @@ -177,24 +116,6 @@ version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" -[[package]] -name = "miniz_oxide" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" -dependencies = [ - "adler2", -] - -[[package]] -name = "object" -version = "0.36.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" -dependencies = [ - "memchr", -] - [[package]] name = "once_cell" version = "1.21.3" @@ -225,12 +146,6 @@ version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6" -[[package]] -name = "rustc-demangle" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" - [[package]] name = "ryu" version = "1.0.20" @@ -269,18 +184,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_yaml" -version = "0.8.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" -dependencies = [ - "indexmap", - "ryu", - "serde", - "yaml-rust", -] - [[package]] name = "similar" version = "2.7.0" @@ -316,12 +219,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" -[[package]] -name = "uuid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" - [[package]] name = "wasm-bindgen" version = "0.2.101" diff --git a/Cargo.toml b/Cargo.toml index c9dea56..b4b9238 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ authors = [ "Brandon Williams ", ] edition = "2018" -rust-version = "1.65" +rust-version = "1.66" license = "Apache-2.0" description = "A diff library for Rust (fork of similar)" repository = "https://github.com/barrett-ruth/likewise" @@ -72,6 +72,3 @@ required-features = ["text", "serde"] [profile.release] debug = true - -[profile.test] -debug = true diff --git a/clippy.toml b/clippy.toml index e034672..e90d7e3 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1 @@ -msrv = "1.65.0" +msrv = "1.66.0" From bd0a533d3f84c755555c4867a1b5f9bbb3e8e1fd Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 11 Sep 2025 14:45:37 -0500 Subject: [PATCH 15/18] fix versioning --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42122ce..5d4c59b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: rust: - stable - beta - - 1.65.0 # MSRV from Cargo.toml + - 1.66.0 # MSRV from Cargo.toml steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master @@ -26,7 +26,7 @@ jobs: toolchain: ${{ matrix.rust }} - uses: Swatinem/rust-cache@v2 - name: Use MSRV lockfile for minimum version testing - if: matrix.rust == '1.65.0' + if: matrix.rust == '1.66.0' run: cp Cargo.lock.msrv Cargo.lock - name: Run tests run: cargo test --verbose From d3ce4b2fb525b9bc01f76d006e449e44368764d6 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 11 Sep 2025 14:48:28 -0500 Subject: [PATCH 16/18] try to fix; --- Cargo.lock.msrv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock.msrv b/Cargo.lock.msrv index dceef63..3d2ee27 100644 --- a/Cargo.lock.msrv +++ b/Cargo.lock.msrv @@ -4,9 +4,9 @@ version = 3 [[package]] name = "bstr" -version = "1.12.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234113d19d0d7d613b40e86fb654acf958910802bcceab913a4f9e7cda03b1a4" +checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" dependencies = [ "memchr", "regex-automata", From e2da405c3d6b1d2c40f39dd7e24c9cdbee73c312 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 11 Sep 2025 14:50:36 -0500 Subject: [PATCH 17/18] 1.66 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5b5e4ef..df09b35 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Crates.io](https://img.shields.io/crates/d/likewise.svg)](https://crates.io/crates/likewise) [![License](https://img.shields.io/github/license/frozen/likewise)](https://github.com/frozen/likewise/blob/main/LICENSE) -[![rustc 1.65.0](https://img.shields.io/badge/rust-1.60%2B-orange.svg)](https://img.shields.io/badge/rust-1.65%2B-orange.svg) +[![rustc 1.66.0](https://img.shields.io/badge/rust-1.66%2B-orange.svg)](https://img.shields.io/badge/rust-1.65%2B-orange.svg) [![Documentation](https://docs.rs/likewise/badge.svg)](https://docs.rs/likewise) Likewise is a dependency free crate for Rust that implements different diffing From 8465f56c85ffee1837001eb114e7e9d2886293bf Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 11 Sep 2025 14:53:01 -0500 Subject: [PATCH 18/18] use the old ci --- .github/workflows/ci.yml | 74 ------------------------------------- .github/workflows/tests.yml | 4 +- 2 files changed, 2 insertions(+), 76 deletions(-) delete mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 5d4c59b..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: CI - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -env: - CARGO_TERM_COLOR: always - -jobs: - test: - name: Test Suite - runs-on: ubuntu-latest - strategy: - matrix: - rust: - - stable - - beta - - 1.66.0 # MSRV from Cargo.toml - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ matrix.rust }} - - uses: Swatinem/rust-cache@v2 - - name: Use MSRV lockfile for minimum version testing - if: matrix.rust == '1.66.0' - run: cp Cargo.lock.msrv Cargo.lock - - name: Run tests - run: cargo test --verbose - - name: Run tests with all features - run: cargo test --all-features --verbose - - feature-tests: - name: Feature Tests - runs-on: ubuntu-latest - strategy: - matrix: - features: - - "text" - - "unicode" - - "bytes" - - "inline" - - "serde" - - "text,unicode" - - "text,bytes" - - "text,inline" - - "text,serde" - - "text,unicode,bytes" - - "text,unicode,inline" - - "text,unicode,serde" - - "text,bytes,inline" - - "text,bytes,serde" - - "text,inline,serde" - - "unicode,bytes,inline,serde" - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - name: Test with features ${{ matrix.features }} - run: cargo test --features ${{ matrix.features }} --verbose - - fmt: - name: Rustfmt - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - with: - components: rustfmt - - name: Run rustfmt - run: cargo fmt --all -- --check diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7240575..e6d5226 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,14 +16,14 @@ jobs: run: make test build-stable: - name: Build on 1.60.0 + name: Build on 1.66.0 runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@master with: - toolchain: 1.60.0 + toolchain: 1.66.0 - name: Use Cargo.lock.msrv run: cp Cargo.lock.msrv Cargo.lock - name: Test