From 964bc7b7f30aa464a8d35ea0dba7ae340cd2b74f Mon Sep 17 00:00:00 2001 From: Brooks J Rady Date: Thu, 29 Apr 2021 16:15:37 +0100 Subject: [PATCH] fix(style): fix up some unneeded `.as_mut()` and `if let` --- src/client/panes/grid.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/panes/grid.rs b/src/client/panes/grid.rs index f2bedbce..935c3203 100644 --- a/src/client/panes/grid.rs +++ b/src/client/panes/grid.rs @@ -611,7 +611,7 @@ impl Grid { row.replace_beginning_with(line_part); } pub fn clear_all_after_cursor(&mut self, replace_with: TerminalCharacter) { - if let Some(cursor_row) = self.viewport.get_mut(self.cursor.y).as_mut() { + if let Some(cursor_row) = self.viewport.get_mut(self.cursor.y) { cursor_row.truncate(self.cursor.x); let replace_with_columns = vec![replace_with; self.width]; self.replace_characters_in_line_after_cursor(replace_with); @@ -621,7 +621,7 @@ impl Grid { } } pub fn clear_all_before_cursor(&mut self, replace_with: TerminalCharacter) { - if let Some(cursor_row) = self.viewport.get_mut(self.cursor.y).as_mut() { + if self.viewport.get(self.cursor.y).is_some() { self.replace_characters_in_line_before_cursor(replace_with); let replace_with_columns = vec![replace_with; self.width]; for row in self.viewport.iter_mut().take(self.cursor.y) {