Change as_tag_tuple to work by reference

This commit is contained in:
Armin Ronacher 2021-01-24 11:25:27 +01:00
parent 16d1eea8fc
commit 1baa23ddcc
3 changed files with 4 additions and 2 deletions

View file

@ -68,8 +68,8 @@ impl DiffOp {
/// * `Delete`: `a[i1..i2]` should be deleted (`j1 == j2` in this case).
/// * `Insert`: `b[j1..j2]` should be inserted at `a[i1..i2]` (`i1 == i2` in this case).
/// * `Equal`: `a[i1..i2]` is equal to `b[j1..j2]`.
pub fn as_tag_tuple(self) -> (DiffTag, Range<usize>, Range<usize>) {
match self {
pub fn as_tag_tuple(&self) -> (DiffTag, Range<usize>, Range<usize>) {
match *self {
DiffOp::Equal {
old_index,
new_index,