Create an inline diff where the new line was completely inserted.
(old_content: &'a [u8], new_content: &'a [u8])
| 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 { |
| 387 | let new_hunks = if !new_content.is_empty() { |
| 388 | vec![ChangeHunk::inserted(0, new_content.len())] |
| 389 | } else { |
| 390 | vec![] |
| 391 | }; |
| 392 | |
| 393 | Self { |
| 394 | old_content, |
| 395 | new_content, |
| 396 | old_hunks: vec![], |
| 397 | new_hunks, |
| 398 | has_changes: true, |
| 399 | } |
| 400 | } |
| 401 | |
| 402 | /// Get the original old line content. |
| 403 | #[inline] |