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

Method old_range

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

Get the range of lines affected in the old sequence.

(&self)

Source from the content-addressed store, hash-verified

174
175 /// Get the range of lines affected in the old sequence.
176 pub fn old_range(&self) -> Range<usize> {
177 match *self {
178 DiffOp::Equal { old_pos, len, .. } => old_pos..old_pos + len,
179 DiffOp::Insert { old_pos, .. } => old_pos..old_pos,
180 DiffOp::Delete { old_pos, len, .. } => old_pos..old_pos + len,
181 DiffOp::Replace {
182 old_pos, old_len, ..
183 } => old_pos..old_pos + old_len,
184 }
185 }
186
187 /// Get the range of lines affected in the new sequence.
188 pub fn new_range(&self) -> Range<usize> {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected