diff options
author | Christian Duerr <chrisduerr@users.noreply.github.com> | 2018-01-06 01:42:55 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-06 01:42:55 +0000 |
commit | 2920cbe7103f03a45080bfb7610bd7f481f36361 (patch) | |
tree | 4839deca8a54d8e2546d124eb26178fd1eac4d4a /src/lib.rs | |
parent | 650b5a0cbaccc6de2b53240372c2be79739d5d12 (diff) | |
download | alacritty-2920cbe7103f03a45080bfb7610bd7f481f36361.tar.gz alacritty-2920cbe7103f03a45080bfb7610bd7f481f36361.zip |
Add clippy check to travis
This commit adds clippy as a required step of the build process. To make
this possible, all existing clippy issues have been resolved.
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -15,6 +15,7 @@ //! Alacritty - The GPU Enhanced Terminal #![cfg_attr(feature = "clippy", feature(plugin))] #![cfg_attr(feature = "clippy", plugin(clippy))] +#![cfg_attr(feature = "clippy", deny(clippy))] #![cfg_attr(feature = "clippy", deny(enum_glob_use))] #![cfg_attr(feature = "clippy", deny(if_not_else))] #![cfg_attr(feature = "clippy", deny(wrong_pub_self_convention))] @@ -82,7 +83,7 @@ use std::ops::Mul; pub use grid::Grid; pub use term::Term; -/// Facade around [winit's MouseCursor](glutin::MouseCursor) +/// Facade around [winit's `MouseCursor`](glutin::MouseCursor) #[derive(Debug, Eq, PartialEq, Copy, Clone)] pub enum MouseCursor { Arrow, @@ -102,9 +103,9 @@ impl Mul<f32> for Rgb { fn mul(self, rhs: f32) -> Rgb { let result = Rgb { - r: (self.r as f32 * rhs).max(0.0).min(255.0) as u8, - g: (self.g as f32 * rhs).max(0.0).min(255.0) as u8, - b: (self.b as f32 * rhs).max(0.0).min(255.0) as u8 + r: (f32::from(self.r) * rhs).max(0.0).min(255.0) as u8, + g: (f32::from(self.g) * rhs).max(0.0).min(255.0) as u8, + b: (f32::from(self.b) * rhs).max(0.0).min(255.0) as u8 }; trace!("Scaling RGB by {} from {:?} to {:?}", rhs, self, result); |