Create an inline diff where the old line was completely deleted.
(old_content: &'a [u8], new_content: &'a [u8])
| 367 | |
| 368 | /// Create an inline diff where the old line was completely deleted. |
| 369 | fn all_deleted(old_content: &'a [u8], new_content: &'a [u8]) -> Self { |
| 370 | let old_hunks = if !old_content.is_empty() { |
| 371 | vec![ChangeHunk::deleted(0, old_content.len())] |
| 372 | } else { |
| 373 | vec![] |
| 374 | }; |
| 375 | |
| 376 | Self { |
| 377 | old_content, |
| 378 | new_content, |
| 379 | old_hunks, |
| 380 | new_hunks: vec![], |
| 381 | has_changes: true, |
| 382 | } |
| 383 | } |
| 384 | |
| 385 | /// Create an inline diff where the new line was completely inserted. |
| 386 | fn all_inserted(old_content: &'a [u8], new_content: &'a [u8]) -> Self { |