History

Last stretch to fix CI

GPT 5.4 committed 6 months ago

Commit 1be2d4d1 parent 3ec346b3 files · +17 −17Browse files

Unified · Split

3 files
  1. gix-diff/src/blob/unified_diff/mod.rs +2 −2
  2. gix-diff/tests/diff/blob/slider.rs +11 −11
  3. gix-imara-diff/src/lib.rs +4 −4
gix-diff/src/blob/unified_diff/mod.rs+2−2
@@ -71,7 +71,7 @@ pub trait ConsumeBinaryHunkDelegate { · 70 unmodified lines
7171 fn consume_binary_hunk(&mut self, header: HunkHeader, header_str: &str, hunk: &[u8]) -> std::io::Result<()>;
7272 }
7373
74−/// A utility trait for use in [`UnifiedDiff`].
74+/// A utility trait for use in [`crate::blob::UnifiedDiff`].
7575 pub trait ConsumeHunk {
7676 /// The item this instance produces after consuming all hunks.
7777 type Out;
@@ -80,7 +80,7 @@ pub trait ConsumeHunk { · 2 unmodified lines
8080 /// and the original token bytes (`&[u8]`) for that line without the unified diff prefix character.
8181 /// The `header` specifies hunk offsets, which positions the `lines` in the old and new file respectively.
8282 ///
83− /// Note that [`UnifiedDiff`] will wrap its output in an [`std::io::Result`].
83+ /// Note that [`crate::blob::UnifiedDiff`] will wrap its output in an [`std::io::Result`].
8484 /// After this method returned its first error, it will not be called anymore.
8585 fn consume_hunk(&mut self, header: HunkHeader, lines: &[(DiffLineKind, &[u8])]) -> std::io::Result<()>;
8686
gix-diff/tests/diff/blob/slider.rs+11−11
@@ -182,10 +182,10 @@ mod heuristics { · 181 unmodified lines
182182
183183 insta::assert_snapshot!(util::unidiff(&diff, &input), @r#"
184184 @@ -2,1 +2,1 @@
185− - let x = 1;
186− + let x = 2;
185+ - let x = 1;
186+ + let x = 2;
187187 @@ -4,0 +4,1 @@
188− + println!("done");
188+ + println!("done");
189189 "#);
190190 Ok(())
191191 }
@@ -212,10 +212,10 @@ mod heuristics { · 20 unmodified lines
212212
213213 insta::assert_snapshot!(util::unidiff(&diff, &input), @r#"
214214 @@ -2,1 +2,1 @@
215− - let x = 1;
216− + let x = 2;
215+ - let x = 1;
216+ + let x = 2;
217217 @@ -4,0 +4,1 @@
218− + println!("done");
218+ + println!("done");
219219 "#);
220220 Ok(())
221221 }
@@ -243,7 +243,7 @@ mod heuristics { · 21 unmodified lines
243243
244244 insta::assert_snapshot!(util::unidiff(&diff, &input), @r#"
245245 @@ -4,0 +4,1 @@
246− + println!("world");
246+ + println!("world");
247247 "#);
248248
249249 Ok(())
@@ -311,12 +311,12 @@ mod heuristics { · 61 unmodified lines
311311 let input = blob::InternedInput::new(before, after);
312312 let diff = diff_with_slider_heuristics(blob::Algorithm::Histogram, &input);
313313
314− insta::assert_snapshot!(util::unidiff(&diff, &input), @r"
314+ insta::assert_snapshot!(util::unidiff(&diff, &input), @"
315315 @@ -3,0 +3,1 @@
316− + y: i32,
316+ + y: i32,
317317 @@ -7,1 +8,1 @@
318− - Foo { x: 0 }
319− + Foo { x: 0, y: 0 }
318+ - Foo { x: 0 }
319+ + Foo { x: 0, y: 0 }
320320 ");
321321
322322 Ok(())
gix-imara-diff/src/lib.rs+4−4
@@ -91,13 +91,13 @@ · 90 unmodified lines
9191 //! [`Diff::hunks`], which returns a list of additions/removals/modifications in the
9292 //! order that they appear in the input.
9393 //!
94−//! Finally, if the `unified_diff` feature is enabled, a diff can be printed with
95−//! [`Diff::unified_diff`] to print a unified diff/patch as shown by `git diff` or `diff
96−//! -u`. Note that while the unified diff has a decent amount of flexibility, it is fairly
94+//! Finally, when built with the `unified_diff` feature, this crate also provides a
95+//! built-in unified diff/patch formatter similar to `git diff` or `diff -u`.
96+//! Note that while the formatter has a decent amount of flexibility, it is fairly
9797 //! simplistic and not every formatting may be possible. It's meant to cover common
9898 //! situations but not cover every advanced use case. Instead, if you need more advanced
9999 //! printing, build your own printer on top of the [`Diff::hunks`] iterator; for that, you can
100−//! take inspiration from the built-in printer.
100+//! take inspiration from the built-in printer implementation.
101101 //!
102102 //! ```
103103 //! # use gix_imara_diff::{InternedInput, Diff, Algorithm, BasicLineDiffPrinter, UnifiedDiffConfig};