From 6d60a49956facc63ab5e0ebac8eb15ab7347ea9a Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Thu, 12 Mar 2020 22:49:46 +0000 Subject: Run clippy on oldest supported version Since there were some problems with clippy suggesting changes that were not yet available in the oldest supported Rust compiler of Alacritty, the clippy stage has been moved from stable to 1.37.0. --- alacritty/src/cursor.rs | 2 +- alacritty/src/input.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'alacritty/src') diff --git a/alacritty/src/cursor.rs b/alacritty/src/cursor.rs index 734c6817..e18816ed 100644 --- a/alacritty/src/cursor.rs +++ b/alacritty/src/cursor.rs @@ -33,7 +33,7 @@ pub fn get_cursor_glyph( // Calculate the cell metrics let height = metrics.line_height as i32 + i32::from(offset_y); let mut width = metrics.average_advance as i32 + i32::from(offset_x); - let line_width = cmp::max((width as f64 * CURSOR_WIDTH_PERCENTAGE).round() as i32, 1); + let line_width = cmp::max((f64::from(width) * CURSOR_WIDTH_PERCENTAGE).round() as i32, 1); // Double the cursor width if it's above a double-width glyph if is_wide { diff --git a/alacritty/src/input.rs b/alacritty/src/input.rs index 01adedbc..844710d7 100644 --- a/alacritty/src/input.rs +++ b/alacritty/src/input.rs @@ -469,7 +469,7 @@ impl<'a, T: EventListener, A: ActionContext> Processor<'a, T, A> { match delta { MouseScrollDelta::LineDelta(_columns, lines) => { let new_scroll_px = lines * self.ctx.size_info().cell_height; - self.scroll_terminal(new_scroll_px as f64); + self.scroll_terminal(f64::from(new_scroll_px)); }, MouseScrollDelta::PixelDelta(lpos) => { match phase { @@ -487,7 +487,7 @@ impl<'a, T: EventListener, A: ActionContext> Processor<'a, T, A> { } fn scroll_terminal(&mut self, new_scroll_px: f64) { - let height = self.ctx.size_info().cell_height as f64; + let height = f64::from(self.ctx.size_info().cell_height); if self.ctx.terminal().mode().intersects(TermMode::MOUSE_MODE) { self.ctx.mouse_mut().scroll_px += new_scroll_px; -- cgit