Get the new range if this operation references new tokens. Returns `Some(range)` for Equal, Insert, and Replace operations. Returns `None` for Delete operations.
(&self)
| 201 | /// Returns `Some(range)` for Equal, Insert, and Replace operations. |
| 202 | /// Returns `None` for Delete operations. |
| 203 | pub fn new_range(&self) -> Option<Range<usize>> { |
| 204 | match self { |
| 205 | WordDiffOp::Equal { new_range, .. } => Some(new_range.clone()), |
| 206 | WordDiffOp::Insert { new_range, .. } => Some(new_range.clone()), |
| 207 | WordDiffOp::Replace { new_range, .. } => Some(new_range.clone()), |
| 208 | WordDiffOp::Delete { .. } => None, |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | /// Get the number of old tokens affected by this operation. |
| 213 | pub fn old_len(&self) -> usize { |