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

Method insertions

atomic-core/src/diff/word.rs:367–376  ·  view source on GitHub ↗

Count the number of inserted tokens.

(&self)

Source from the content-addressed store, hash-verified

365
366 /// Count the number of inserted tokens.
367 pub fn insertions(&self) -> usize {
368 self.ops
369 .iter()
370 .map(|op| match op {
371 WordDiffOp::Insert { new_range, .. } => new_range.len(),
372 WordDiffOp::Replace { new_range, .. } => new_range.len(),
373 _ => 0,
374 })
375 .sum()
376 }
377
378 /// Count the number of deleted tokens.
379 pub fn deletions(&self) -> usize {

Callers 1

edit_distanceMethod · 0.45

Calls 2

iterMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected