From cb1371693d58f861562aed230e037d8c7b8dc35f Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sat, 23 Nov 2024 11:44:49 +0000 Subject: [PATCH] Remove extend --- backend/reconcile/src/diffs/raw_operation.rs | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/backend/reconcile/src/diffs/raw_operation.rs b/backend/reconcile/src/diffs/raw_operation.rs index 51c2f2c3..030f0c7d 100644 --- a/backend/reconcile/src/diffs/raw_operation.rs +++ b/backend/reconcile/src/diffs/raw_operation.rs @@ -26,22 +26,4 @@ impl RawOperation { pub fn get_original_text(self) -> String { self.tokens().iter().map(|t| t.original.clone()).collect() } - - /// Extends the operation with another operation if returning the new operation. - /// Only operations of the same type can be used to extend. If the operations are of different - /// types, returns None. - pub fn extend(&self, other: &RawOperation) -> Option { - match (self, other) { - (RawOperation::Insert(tokens1), RawOperation::Insert(tokens2)) => Some( - RawOperation::Insert(tokens1.iter().chain(tokens2.iter()).cloned().collect()), - ), - (RawOperation::Delete(tokens1), RawOperation::Delete(tokens2)) => Some( - RawOperation::Delete(tokens1.iter().chain(tokens2.iter()).cloned().collect()), - ), - (RawOperation::Equal(tokens1), RawOperation::Equal(tokens2)) => Some( - RawOperation::Equal(tokens1.iter().chain(tokens2.iter()).cloned().collect()), - ), - _ => None, - } - } }