Showing the changes to gix-diff/src/blob/unified_diff (1 of 3 files). Show all
Unified · Split
| @@ -71,7 +71,7 @@ pub trait ConsumeBinaryHunkDelegate { · 70 unmodified lines | |||
| 71 | fn consume_binary_hunk(&mut self, header: HunkHeader, header_str: &str, hunk: &[u8]) -> std::io::Result<()>; | 71 | fn consume_binary_hunk(&mut self, header: HunkHeader, header_str: &str, hunk: &[u8]) -> std::io::Result<()>; |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | /// A utility trait for use in [`UnifiedDiff`]. | 74 | /// A utility trait for use in [`crate::blob::UnifiedDiff`]. |
| 75 | pub trait ConsumeHunk { | 75 | pub trait ConsumeHunk { |
| 76 | /// The item this instance produces after consuming all hunks. | 76 | /// The item this instance produces after consuming all hunks. |
| 77 | type Out; | 77 | type Out; |
| @@ -80,7 +80,7 @@ pub trait ConsumeHunk { · 2 unmodified lines | |||
| 80 | /// and the original token bytes (`&[u8]`) for that line without the unified diff prefix character. | 80 | /// and the original token bytes (`&[u8]`) for that line without the unified diff prefix character. |
| 81 | /// The `header` specifies hunk offsets, which positions the `lines` in the old and new file respectively. | 81 | /// The `header` specifies hunk offsets, which positions the `lines` in the old and new file respectively. |
| 82 | /// | 82 | /// |
| 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`]. |
| 84 | /// After this method returned its first error, it will not be called anymore. | 84 | /// After this method returned its first error, it will not be called anymore. |
| 85 | fn consume_hunk(&mut self, header: HunkHeader, lines: &[(DiffLineKind, &[u8])]) -> std::io::Result<()>; | 85 | fn consume_hunk(&mut self, header: HunkHeader, lines: &[(DiffLineKind, &[u8])]) -> std::io::Result<()>; |
| 86 | 86 | ||