diff options
Diffstat (limited to 'helix-core/src/transaction.rs')
-rw-r--r-- | helix-core/src/transaction.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/helix-core/src/transaction.rs b/helix-core/src/transaction.rs index d707016b..aaf912dd 100644 --- a/helix-core/src/transaction.rs +++ b/helix-core/src/transaction.rs @@ -84,11 +84,7 @@ impl ChangeSet { } let new_last = match self.changes.as_mut_slice() { - [.., Insert(prev)] => { - prev.push_tendril(&fragment); - return; - } - [.., Insert(prev), Delete(_)] => { + [.., Insert(prev)] | [.., Insert(prev), Delete(_)] => { prev.push_tendril(&fragment); return; } @@ -115,7 +111,7 @@ impl ChangeSet { /// Combine two changesets together. /// In other words, If `this` goes `docA` → `docB` and `other` represents `docB` → `docC`, the /// returned value will represent the change `docA` → `docC`. - pub fn compose(self, other: ChangeSet) -> Self { + pub fn compose(self, other: Self) -> Self { debug_assert!(self.len_after() == other.len); let len = self.changes.len(); |