diff options
| author | Brooks J Rady <b.j.rady@gmail.com> | 2021-04-29 16:15:37 +0100 |
|---|---|---|
| committer | Brooks J Rady <b.j.rady@gmail.com> | 2021-04-29 16:15:37 +0100 |
| commit | 964bc7b7f30aa464a8d35ea0dba7ae340cd2b74f (patch) | |
| tree | b9cdd527eb4a121258b28e0fd4bf9544dd61f5b8 | |
| parent | fix(build): just kidding, binary assets still need to be in git (diff) | |
| download | sl0ppij-964bc7b7f30aa464a8d35ea0dba7ae340cd2b74f.tar.gz sl0ppij-964bc7b7f30aa464a8d35ea0dba7ae340cd2b74f.tar.xz sl0ppij-964bc7b7f30aa464a8d35ea0dba7ae340cd2b74f.zip | |
fix(style): fix up some unneeded `.as_mut()` and `if let`
| -rw-r--r-- | src/client/panes/grid.rs | 4 |
1 files 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) { |
