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

Method new_range

atomic-core/src/diff/ops.rs:188–197  ·  view source on GitHub ↗

Get the range of lines affected in the new sequence.

(&self)

Source from the content-addressed store, hash-verified

186
187 /// Get the range of lines affected in the new sequence.
188 pub fn new_range(&self) -> Range<usize> {
189 match *self {
190 DiffOp::Equal { new_pos, len, .. } => new_pos..new_pos + len,
191 DiffOp::Insert { new_pos, len, .. } => new_pos..new_pos + len,
192 DiffOp::Delete { new_pos, .. } => new_pos..new_pos,
193 DiffOp::Replace {
194 new_pos, new_len, ..
195 } => new_pos..new_pos + new_len,
196 }
197 }
198
199 /// Get the number of lines deleted by this operation.
200 pub fn deletions(&self) -> usize {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected