aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorChristian Duerr <chrisduerr@users.noreply.github.com>2018-01-06 01:42:55 +0000
committerGitHub <noreply@github.com>2018-01-06 01:42:55 +0000
commit2920cbe7103f03a45080bfb7610bd7f481f36361 (patch)
tree4839deca8a54d8e2546d124eb26178fd1eac4d4a /src/config.rs
parent650b5a0cbaccc6de2b53240372c2be79739d5d12 (diff)
downloadalacritty-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/config.rs')
-rw-r--r--src/config.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/config.rs b/src/config.rs
index d9724e61..be967150 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -178,7 +178,7 @@ impl VisualBellConfig {
/// Visual bell duration in milliseconds
#[inline]
pub fn duration(&self) -> Duration {
- Duration::from_millis(self.duration as u64)
+ Duration::from_millis(u64::from(self.duration))
}
}
@@ -240,7 +240,7 @@ impl Alpha {
self.0 = Self::clamp_to_valid_range(value);
}
- #[inline(always)]
+ #[inline]
pub fn get(&self) -> f32 {
self.0
}
@@ -1152,8 +1152,7 @@ impl FromStr for Rgb {
impl ::std::error::Error for Error {
fn cause(&self) -> Option<&::std::error::Error> {
match *self {
- Error::NotFound => None,
- Error::Empty => None,
+ Error::NotFound | Error::Empty => None,
Error::ReadingEnvHome(ref err) => Some(err),
Error::Io(ref err) => Some(err),
Error::Yaml(ref err) => Some(err),
@@ -1174,8 +1173,7 @@ impl ::std::error::Error for Error {
impl ::std::fmt::Display for Error {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
- Error::NotFound => write!(f, "{}", ::std::error::Error::description(self)),
- Error::Empty => write!(f, "{}", ::std::error::Error::description(self)),
+ Error::NotFound | Error::Empty => write!(f, "{}", ::std::error::Error::description(self)),
Error::ReadingEnvHome(ref err) => {
write!(f, "could not read $HOME environment variable: {}", err)
},
@@ -1218,7 +1216,7 @@ impl Config {
/// 2. $XDG_CONFIG_HOME/alacritty.yml
/// 3. $HOME/.config/alacritty/alacritty.yml
/// 4. $HOME/.alacritty.yml
- pub fn installed_config() -> Option<Cow<'static, Path>> {
+ pub fn installed_config<'a>() -> Option<Cow<'a, Path>> {
// Try using XDG location by default
::xdg::BaseDirectories::with_prefix("alacritty")
.ok()