Get the number of old tokens affected by this operation.
(&self)
| 211 | |
| 212 | /// Get the number of old tokens affected by this operation. |
| 213 | pub fn old_len(&self) -> usize { |
| 214 | match self { |
| 215 | WordDiffOp::Equal { old_range, .. } => old_range.len(), |
| 216 | WordDiffOp::Delete { old_range, .. } => old_range.len(), |
| 217 | WordDiffOp::Replace { old_range, .. } => old_range.len(), |
| 218 | WordDiffOp::Insert { .. } => 0, |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | /// Get the number of new tokens affected by this operation. |
| 223 | pub fn new_len(&self) -> usize { |