From c734d256be08b11c3fda1bd1b4c5fe6061588247 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sun, 6 Apr 2025 12:16:03 +0100 Subject: [PATCH] Fix lint --- .../src/operation_transformation/operation.rs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/backend/reconcile/src/operation_transformation/operation.rs b/backend/reconcile/src/operation_transformation/operation.rs index 87c2212..e194f9c 100644 --- a/backend/reconcile/src/operation_transformation/operation.rs +++ b/backend/reconcile/src/operation_transformation/operation.rs @@ -378,20 +378,20 @@ where .min(last_delete.end_index() as i64 - operation.start_index() as i64 + 1); #[cfg(debug_assertions)] - let result = text - .as_ref() - .map(|text| { - Operation::create_equal_with_text( - operation.end_index().min(last_delete.end_index()), - text.chars().skip(overlap as usize).collect::(), - ) - }) - .unwrap_or_else(|| { + let result = text.as_ref().map_or_else( + || { Operation::create_equal( operation.end_index().min(last_delete.end_index()), (length as i64 - overlap) as usize, ) - }); + }, + |text| { + Operation::create_equal_with_text( + operation.end_index().min(last_delete.end_index()), + text.chars().skip(overlap as usize).collect::(), + ) + }, + ); #[cfg(not(debug_assertions))] let result = Operation::create_equal(