From 983aa1b3665c6b546700767d21d73de72372ddad Mon Sep 17 00:00:00 2001 From: Dispersia Date: Mon, 12 Apr 2021 23:23:47 -0700 Subject: Run cargo fmt --- native/src/widget/pane_grid.rs | 9 +++++---- native/src/widget/text_input/cursor.rs | 4 ++-- native/src/widget/text_input/editor.rs | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'native') diff --git a/native/src/widget/pane_grid.rs b/native/src/widget/pane_grid.rs index 44028f5e..3df7b156 100644 --- a/native/src/widget/pane_grid.rs +++ b/native/src/widget/pane_grid.rs @@ -209,10 +209,11 @@ where cursor_position: Point, messages: &mut Vec, ) { - let mut clicked_region = - self.elements.iter().zip(layout.children()).filter( - |(_, layout)| layout.bounds().contains(cursor_position), - ); + let mut clicked_region = self + .elements + .iter() + .zip(layout.children()) + .filter(|(_, layout)| layout.bounds().contains(cursor_position)); if let Some(((pane, content), layout)) = clicked_region.next() { if let Some(on_click) = &self.on_click { diff --git a/native/src/widget/text_input/cursor.rs b/native/src/widget/text_input/cursor.rs index 1e7aee83..4f3b159b 100644 --- a/native/src/widget/text_input/cursor.rs +++ b/native/src/widget/text_input/cursor.rs @@ -113,7 +113,7 @@ impl Cursor { State::Selection { start, end } if end > 0 => { self.select_range(start, end - 1) } - _ => (), + _ => {} } } @@ -125,7 +125,7 @@ impl Cursor { State::Selection { start, end } if end < value.len() => { self.select_range(start, end + 1) } - _ => (), + _ => {} } } diff --git a/native/src/widget/text_input/editor.rs b/native/src/widget/text_input/editor.rs index 20e42567..0b50a382 100644 --- a/native/src/widget/text_input/editor.rs +++ b/native/src/widget/text_input/editor.rs @@ -20,7 +20,7 @@ impl<'a> Editor<'a> { self.cursor.move_left(self.value); self.value.remove_many(left, right); } - _ => (), + _ => {} } self.value.insert(self.cursor.end(self.value), character); @@ -35,7 +35,7 @@ impl<'a> Editor<'a> { self.cursor.move_left(self.value); self.value.remove_many(left, right); } - _ => (), + _ => {} } self.value.insert_many(self.cursor.end(self.value), content); -- cgit From 8b7452a55def8620f2c91df40d3882c449f85420 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Date: Wed, 19 May 2021 16:26:04 +0700 Subject: Fix formatting with `cargo fmt` --- native/src/widget/pane_grid.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'native') diff --git a/native/src/widget/pane_grid.rs b/native/src/widget/pane_grid.rs index 3df7b156..44028f5e 100644 --- a/native/src/widget/pane_grid.rs +++ b/native/src/widget/pane_grid.rs @@ -209,11 +209,10 @@ where cursor_position: Point, messages: &mut Vec, ) { - let mut clicked_region = self - .elements - .iter() - .zip(layout.children()) - .filter(|(_, layout)| layout.bounds().contains(cursor_position)); + let mut clicked_region = + self.elements.iter().zip(layout.children()).filter( + |(_, layout)| layout.bounds().contains(cursor_position), + ); if let Some(((pane, content), layout)) = clicked_region.next() { if let Some(on_click) = &self.on_click { -- cgit