From 21c75d9d94e1a338501d2011f17710ff5174ac01 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Wed, 12 Oct 2022 04:40:46 +0000 Subject: Fix clippy warnings This patch applies all clippy lints currently present on the latest clippy master than are compatible with our oldstable clippy (only exception is the `_else(||` stuff). --- alacritty_terminal/src/term/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'alacritty_terminal/src/term/mod.rs') diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs index 8317e701..98f76d52 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -202,7 +202,7 @@ impl TermDamageState { /// Damage point inside of the viewport. #[inline] fn damage_point(&mut self, point: Point) { - self.damage_line(point.line, point.column.0 as usize, point.column.0 as usize); + self.damage_line(point.line, point.column.0, point.column.0); } /// Expand `line`'s damage to span at least `left` to `right` column. @@ -228,7 +228,7 @@ impl TermDamageState { }; let start = cmp::max(selection.start.line.0 + display_offset, 0); - let end = cmp::min(cmp::max(selection.end.line.0 + display_offset, 0), last_visible_line); + let end = (selection.end.line.0 + display_offset).clamp(0, last_visible_line); for line in start as usize..=end as usize { self.damage_line(line, 0, num_cols - 1); } @@ -1244,7 +1244,7 @@ impl Handler for Term { if self.grid.cursor.point.column > Column(0) { let line = self.grid.cursor.point.line.0 as usize; - let column = self.grid.cursor.point.column.0 as usize; + let column = self.grid.cursor.point.column.0; self.grid.cursor.point.column -= 1; self.grid.cursor.input_needs_wrap = false; self.damage.damage_line(line, column - 1, column); @@ -1547,7 +1547,7 @@ impl Handler for Term { self.event_proxy.send_event(Event::ClipboardLoad( clipboard_type, Arc::new(move |text| { - let base64 = base64::encode(&text); + let base64 = base64::encode(text); format!("\x1b]52;{};{}{}", clipboard as char, base64, terminator) }), )); -- cgit v1.2.3-54-g00ecf