diff --git a/font/src/ft/fc/mod.rs b/font/src/ft/fc/mod.rs index a999a40..5e5deb0 100644 --- a/font/src/ft/fc/mod.rs +++ b/font/src/ft/fc/mod.rs @@ -72,7 +72,6 @@ pub fn font_match( } /// list fonts by closeness to the pattern -#[allow(dead_code)] pub fn font_sort( config: &ConfigRef, pattern: &mut PatternRef, @@ -104,7 +103,6 @@ pub fn font_sort( } /// List fonts matching pattern -#[allow(dead_code)] pub fn font_list( config: &ConfigRef, pattern: &mut PatternRef, diff --git a/src/config.rs b/src/config.rs index 5e30b65..85859cf 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1459,7 +1459,7 @@ impl Config { /// 2. $XDG_CONFIG_HOME/alacritty.yml /// 3. $HOME/.config/alacritty/alacritty.yml /// 4. $HOME/.alacritty.yml - #[cfg(not(windows))] + #[cfg(not(windows))] pub fn installed_config<'a>() -> Option> { // Try using XDG location by default ::xdg::BaseDirectories::with_prefix("alacritty") @@ -1489,7 +1489,7 @@ impl Config { } #[cfg(windows)] - pub fn installed_config() -> Option> { + pub fn installed_config<'a>() -> Option> { if let Some(mut path) = ::std::env::home_dir() { path.push("alacritty"); path.set_extension("yml"); @@ -1512,7 +1512,7 @@ impl Config { #[cfg(windows)] pub fn write_defaults() -> io::Result> { let path = ::std::env::home_dir() - .ok_or(io::Error::new(io::ErrorKind::NotFound, "could not find profile directory")) + .ok_or_else(|| io::Error::new(io::ErrorKind::NotFound, "could not find profile directory")) .and_then(|mut p| {p.push("alacritty"); p.set_extension("yml"); Ok(p)})?; File::create(&path)?.write_all(DEFAULT_ALACRITTY_CONFIG.as_bytes())?; Ok(path.into()) @@ -2101,7 +2101,6 @@ mod tests { } } -#[cfg_attr(feature = "cargo-clippy", allow(enum_variant_names))] #[derive(Deserialize, Copy, Clone, Debug, Eq, PartialEq)] pub enum Key { Scancode(u32), diff --git a/src/index.rs b/src/index.rs index 8ac1ab3..e490c72 100644 --- a/src/index.rs +++ b/src/index.rs @@ -347,7 +347,6 @@ macro_rules! ops { impl $ty { #[inline] - #[allow(trivial_numeric_casts)] fn steps_between(start: $ty, end: $ty, by: $ty) -> Option { if by == $construct(0) { return None; } if start < end { diff --git a/src/input.rs b/src/input.rs index 5c4436b..5235066 100644 --- a/src/input.rs +++ b/src/input.rs @@ -320,10 +320,10 @@ impl RelaxedEq for ModifiersState { // Make sure that modifiers in the config are always present, // but ignore surplus modifiers. fn relaxed_eq(&self, other: Self) -> bool { - !((self.shift && !other.shift) - || (self.ctrl && !other.ctrl) - || (self.alt && !other.alt) - || (self.logo && !other.logo)) + (!self.logo || other.logo) + && (!self.alt || other.alt) + && (!self.ctrl || other.ctrl) + && (!self.shift || other.shift) } } diff --git a/src/lib.rs b/src/lib.rs index 810e9a2..170d3f5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -127,9 +127,7 @@ impl Mul for Rgb { } -#[allow(unused_mut)] pub mod gl { - #![allow(non_upper_case_globals)] #![cfg_attr(feature = "cargo-clippy", allow(clippy))] include!(concat!(env!("OUT_DIR"), "/gl_bindings.rs")); } diff --git a/src/main.rs b/src/main.rs index 57a7ba2..af21b98 100644 --- a/src/main.rs +++ b/src/main.rs @@ -89,7 +89,6 @@ fn main() { /// If a configuration file is given as a command line argument we don't /// generate a default file. If an empty configuration file is given, i.e. /// /dev/null, we load the compiled-in defaults.) -#[cfg(not(windows))] fn load_config(options: &cli::Options) -> Config { let config_path = options.config_path() .or_else(Config::installed_config) @@ -103,27 +102,6 @@ fn load_config(options: &cli::Options) -> Config { Config::default() }) } -#[cfg(windows)] -fn load_config(options: &cli::Options) -> Config { - let config_path = options - .config_path() - .or_else(|| Config::installed_config()) - .unwrap_or_else(|| { - Config::write_defaults() - .unwrap_or_else(|err| die!("Write defaults config failure: {}", err)) - }); - - Config::load_from(&*config_path).unwrap_or_else(|err| match err { - config::Error::NotFound => { - die!("Config file not found after writing: {}", config_path.display()); - } - config::Error::Empty => { - eprintln!("Empty config; Loading defaults"); - Config::default() - } - _ => die!("{}", err), - }) -} /// Run Alacritty ///