Diff two byte slices as text, splitting on newlines. This is a convenience function that handles the common case of diffing two text files. It splits both inputs on newlines, diffs the resulting lines, and returns the operations. # Arguments `old` - The original text content `new` - The modified text content `algorithm` - Which diff algorithm to use # Returns A [`DiffResult`] containing the d
(old: &[u8], new: &[u8], algorithm: Algorithm)
| 542 | /// assert!(!result.is_empty()); |
| 543 | /// ``` |
| 544 | pub fn diff_text(old: &[u8], new: &[u8], algorithm: Algorithm) -> DiffResult { |
| 545 | let old_lines: Vec<Line> = Line::from_bytes(old); |
| 546 | let new_lines: Vec<Line> = Line::from_bytes(new); |
| 547 | diff(&old_lines, &new_lines, algorithm) |
| 548 | } |
| 549 | |
| 550 | /// Diff two byte slices as text using a custom separator pattern. |
| 551 | /// |