Skip to content

Commit

Permalink
Fixed the 'cast_lossless' clippy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ZapAnton committed Oct 31, 2019
1 parent 54d9951 commit 3582a88
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/image_backends/kitty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,17 @@ impl super::ImageBackend for KittyBackend {
ioctl(STDOUT_FILENO, TIOCGWINSZ, &tty_size);
tty_size
};
let width_ratio = tty_size.ws_col as f64 / tty_size.ws_xpixel as f64;
let height_ratio = tty_size.ws_row as f64 / tty_size.ws_ypixel as f64;
let width_ratio = f64::from(tty_size.ws_col) / f64::from(tty_size.ws_xpixel);
let height_ratio = f64::from(tty_size.ws_row) / f64::from(tty_size.ws_ypixel);

// resize image to fit the text height with the Lanczos3 algorithm
let image = image.resize(
u32::max_value(),
(lines.len() as f64 / height_ratio) as u32,
FilterType::Lanczos3,
);
let _image_columns = width_ratio * image.width() as f64;
let image_rows = height_ratio * image.height() as f64;
let _image_columns = width_ratio * f64::from(image.width());
let image_rows = height_ratio * f64::from(image.height());

// convert the image to rgba samples
let rgba_image = image.to_rgba();
Expand Down

0 comments on commit 3582a88

Please sign in to comment.