From 4314ce36f4242398a3228defc70e056e1e87f175 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 11 Jul 2020 00:11:45 +0200 Subject: Remove redundant `min` checks in `Editor` --- native/src/widget/text_input/editor.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'native') diff --git a/native/src/widget/text_input/editor.rs b/native/src/widget/text_input/editor.rs index b836f105..20e42567 100644 --- a/native/src/widget/text_input/editor.rs +++ b/native/src/widget/text_input/editor.rs @@ -18,7 +18,7 @@ impl<'a> Editor<'a> { match self.cursor.selection(self.value) { Some((left, right)) => { self.cursor.move_left(self.value); - self.value.remove_many(left, right.min(self.value.len())); + self.value.remove_many(left, right); } _ => (), } @@ -33,7 +33,7 @@ impl<'a> Editor<'a> { match self.cursor.selection(self.value) { Some((left, right)) => { self.cursor.move_left(self.value); - self.value.remove_many(left, right.min(self.value.len())); + self.value.remove_many(left, right); } _ => (), } @@ -47,7 +47,7 @@ impl<'a> Editor<'a> { match self.cursor.selection(self.value) { Some((start, end)) => { self.cursor.move_left(self.value); - self.value.remove_many(start, end.min(self.value.len())); + self.value.remove_many(start, end); } None => { let start = self.cursor.start(self.value); -- cgit