MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / all_inserted

Method all_inserted

atomic-core/src/diff/inline.rs:386–400  ·  view source on GitHub ↗

Create an inline diff where the new line was completely inserted.

(old_content: &'a [u8], new_content: &'a [u8])

Source from the content-addressed store, hash-verified

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]

Callers

nothing calls this directly

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected