From 6e1b1a8e6da05e9340b06eeb6c6696bbce09550a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 7 Dec 2025 15:50:23 +0000 Subject: [PATCH 1/2] Initial plan From a17980fa592ab9151401a1ccb8f2d85692a964eb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 7 Dec 2025 15:55:19 +0000 Subject: [PATCH 2/2] Fix spelling and grammar errors throughout the codebase Co-authored-by: Byron <63622+Byron@users.noreply.github.com> --- README.md | 4 ++-- src/histogram.rs | 4 ++-- src/intern.rs | 6 +++--- src/lib.rs | 2 +- src/sink.rs | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f418c75..fc09118 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ `imara-diff` is a solid (imara in swahili) diff library for rust. Solid refers to the fact that imara-diff provides very good runtime performance even -in pathologic cases so that your application never appears to freeze while waiting on a diff. +in pathological cases so that your application never appears to freeze while waiting on a diff. The performance improvements are achieved using battle tested heuristics used in gnu-diff and git that are known to perform well while still providing good results. @@ -86,7 +86,7 @@ The sourcecode of the rust compiler, standard library and various related toolin -### VScode +### VSCode The sourcecode of the vscode editor. diff --git a/src/histogram.rs b/src/histogram.rs index f44b650..ff2cb0e 100644 --- a/src/histogram.rs +++ b/src/histogram.rs @@ -96,7 +96,7 @@ impl Histogram { &mut added[..lcs.after_start as usize], ); - // this is equivalent to (tail) recursion but implement as a loop for efficeny reasons + // this is equivalent to (tail) recursion but implement as a loop for efficiency reasons let before_end = lcs.before_start + lcs.len; before = &before[before_end as usize..]; removed = &mut removed[before_end as usize..]; @@ -108,7 +108,7 @@ impl Histogram { None => { // we are diffing two extremely large repetitive files // this is a worst case for histogram diff with O(N^2) performance - // fallback to myers to maintain linear time complxity + // fallback to myers to maintain linear time complexity myers::diff(before, after, removed, added, false); return; } diff --git a/src/intern.rs b/src/intern.rs index 9c70eb3..f93fb54 100644 --- a/src/intern.rs +++ b/src/intern.rs @@ -109,7 +109,7 @@ impl InternedInput { /// to allocate if their [`estimate_tokens`](TokenSource::estimate_tokens) /// would represent an exact match of their actual tokens. /// - /// Useful for minimisation of allocation before calls to + /// Useful for minimization of allocation before calls to /// [`update_before`](InternedInput::update_before) and /// [`update_after`](InternedInput::update_after). pub fn reserve_for_token_source + ?Sized>( @@ -135,7 +135,7 @@ impl InternedInput { /// replaces `self.before` with the interned Tokens yielded by `input` /// Note that this does not erase any tokens from the interner and might therefore be considered - /// a memory leak. If this function is called often over a long_running process + /// a memory leak. If this function is called often over a long-running process /// consider clearing the interner with [`clear`](Interner::clear). pub fn update_before(&mut self, input: impl Iterator) { self.before.clear(); @@ -145,7 +145,7 @@ impl InternedInput { /// replaces `self.before` with the interned Tokens yielded by `input` /// Note that this does not erase any tokens from the interner and might therefore be considered - /// a memory leak. If this function is called often over a long_running process + /// a memory leak. If this function is called often over a long-running process /// consider clearing the interner with [`clear`](Interner::clear) or /// [`erase_tokens_after`](Interner::erase_tokens_after). pub fn update_after(&mut self, input: impl Iterator) { diff --git a/src/lib.rs b/src/lib.rs index b3245df..ce8d306 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,7 +15,7 @@ //! * The **Histogram** algorithm which is a variant of the patience diff algorithm. //! //! Myers algorithm has been enhanced with preprocessing and multiple heuristics to ensure fast runtime in pathological -//! cases to avoid quadratic time complexity and closely matches the behaviour of gnu-diff and git. +//! cases to avoid quadratic time complexity and closely matches the behavior of gnu-diff and git. //! The Histogram algorithm was originally ported from git but has been heavily optimized. //! The **Histogram algorithm outperforms Myers diff** by 10% - 100% across a **wide variety of workloads**. //! diff --git a/src/sink.rs b/src/sink.rs index baa00ed..07c96b8 100644 --- a/src/sink.rs +++ b/src/sink.rs @@ -62,10 +62,10 @@ impl Sink for () { /// and counts the number of `removed` and `inserted` [tokens](crate::intern::Token). pub struct Counter { /// Total number of recorded inserted [`tokens`](crate::intern::Token). - /// Computed by summing the lengths of the `after` subsequences pass to [`process_change`](crate::Sink::process_change). + /// Computed by summing the lengths of the `after` subsequences passed to [`process_change`](crate::Sink::process_change). pub removals: u32, /// Total number of recorded inserted [`tokens`](crate::intern::Token). - /// Computed by summing the lengths of the `after` subsequences pass to [`process_change`](crate::Sink::process_change). + /// Computed by summing the lengths of the `after` subsequences passed to [`process_change`](crate::Sink::process_change). pub insertions: u32, /// The [`Sink`] for which the counter records [`tokens`](crate::intern::Token). /// All calls to [`process_change`](crate::Sink::process_change) are forwarded to the `sink` by the counter.