aboutsummaryrefslogtreecommitdiff
path: root/src/display.rs
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2018-05-11 20:22:36 +0200
committerJoe Wilm <jwilm@users.noreply.github.com>2018-05-11 16:54:19 -0700
commite34dccdabf210612666cbb9d22d7afff23487eaf (patch)
tree01cfc895cf42fc3f31427cc4543ab62265af3eb8 /src/display.rs
parent57281363503ddd1ebb373ed5de2b84c79d5aa3aa (diff)
downloadalacritty-e34dccdabf210612666cbb9d22d7afff23487eaf.tar.gz
alacritty-e34dccdabf210612666cbb9d22d7afff23487eaf.zip
Fix clippy lints
Diffstat (limited to 'src/display.rs')
-rw-r--r--src/display.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/display.rs b/src/display.rs
index bd8ae401..a237a10f 100644
--- a/src/display.rs
+++ b/src/display.rs
@@ -162,8 +162,8 @@ impl Display {
let height = cell_height as u32 * dimensions.lines_u32();
let new_viewport_size = Size {
- width: Pixels(width + 2 * config.padding().x as u32),
- height: Pixels(height + 2 * config.padding().y as u32),
+ width: Pixels(width + 2 * u32::from(config.padding().x)),
+ height: Pixels(height + 2 * u32::from(config.padding().y)),
};
window.set_inner_size(&new_viewport_size);
@@ -178,8 +178,8 @@ impl Display {
height: viewport_size.height.0 as f32,
cell_width: cell_width as f32,
cell_height: cell_height as f32,
- padding_x: config.padding().x as f32,
- padding_y: config.padding().y as f32,
+ padding_x: f32::from(config.padding().x),
+ padding_y: f32::from(config.padding().y),
};
// Channel for resize events
@@ -238,8 +238,8 @@ impl Display {
// font metrics should be computed before creating the window in the first
// place so that a resize is not needed.
let metrics = glyph_cache.font_metrics();
- let cell_width = metrics.average_advance as f32 + font.offset().x as f32;
- let cell_height = metrics.line_height as f32 + font.offset().y as f32;
+ let cell_width = metrics.average_advance as f32 + f32::from(font.offset().x);
+ let cell_height = metrics.line_height as f32 + f32::from(font.offset().y);
// Prevent invalid cell sizes
if cell_width < 1. || cell_height < 1. {