Diff two byte slices as text using a custom separator pattern. This allows diffing with custom line separators (e.g., for languages that use different conventions or for record-oriented data). # Arguments `old` - The original content `new` - The modified content `separator` - The separator to use for splitting `algorithm` - Which diff algorithm to use # Returns A [`DiffResult`] containing the
(
old: &'a [u8],
new: &'a [u8],
separator: &Separator,
algorithm: Algorithm,
)
| 563 | /// |
| 564 | /// A [`DiffResult`] containing the diff operations. |
| 565 | pub fn diff_with_separator<'a>( |
| 566 | old: &'a [u8], |
| 567 | new: &'a [u8], |
| 568 | separator: &Separator, |
| 569 | algorithm: Algorithm, |
| 570 | ) -> DiffResult { |
| 571 | let old_lines: Vec<Line> = LineSplit::new(old, separator).collect(); |
| 572 | let new_lines: Vec<Line> = LineSplit::new(new, separator).collect(); |
| 573 | diff(&old_lines, &new_lines, algorithm) |
| 574 | } |
| 575 | |
| 576 | /// Three-way merge of byte content. |
| 577 | /// |