From a99a9fd84ce5f7c3e79d172fc140fcdc0ffa47c9 Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Thu, 29 Oct 2020 07:17:33 +0300 Subject: [PATCH] Error on warnings when running clippy It should simplify tracking of new warnings raised on CI builds and when cross checking. This commit also enables warnings for 'rust_2018_idioms' and 'future_incompatible'. --- alacritty/src/event.rs | 12 +++++++----- alacritty/src/main.rs | 2 ++ alacritty_terminal/src/ansi.rs | 2 +- alacritty_terminal/src/lib.rs | 2 ++ 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs index 5da2a939..7c3e786d 100644 --- a/alacritty/src/event.rs +++ b/alacritty/src/event.rs @@ -898,8 +898,8 @@ impl Processor { /// /// Doesn't take self mutably due to borrow checking. fn handle_event( - event: GlutinEvent, - processor: &mut input::Processor>, + event: GlutinEvent<'_, Event>, + processor: &mut input::Processor<'_, T, ActionContext<'_, N, T>>, ) where T: EventListener, { @@ -1044,7 +1044,7 @@ impl Processor { } /// Check if an event is irrelevant and can be skipped. - fn skip_event(event: &GlutinEvent) -> bool { + fn skip_event(event: &GlutinEvent<'_, Event>) -> bool { match event { GlutinEvent::WindowEvent { event, .. } => matches!( event, @@ -1066,8 +1066,10 @@ impl Processor { } } - fn reload_config(path: &PathBuf, processor: &mut input::Processor>) - where + fn reload_config( + path: &PathBuf, + processor: &mut input::Processor<'_, T, ActionContext<'_, N, T>>, + ) where T: EventListener, { if !processor.ctx.message_buffer.is_empty() { diff --git a/alacritty/src/main.rs b/alacritty/src/main.rs index 66806056..dc316c79 100644 --- a/alacritty/src/main.rs +++ b/alacritty/src/main.rs @@ -1,6 +1,8 @@ //! Alacritty - The GPU Enhanced Terminal. +#![warn(rust_2018_idioms, future_incompatible)] #![deny(clippy::all, clippy::if_not_else, clippy::enum_glob_use, clippy::wrong_pub_self_convention)] +#![cfg_attr(feature = "cargo-clippy", deny(warnings))] #![cfg_attr(all(test, feature = "bench"), feature(test))] // With the default subsystem, 'console', windows creates an additional console // window for the program. diff --git a/alacritty_terminal/src/ansi.rs b/alacritty_terminal/src/ansi.rs index 5c2c9e57..877fd65f 100644 --- a/alacritty_terminal/src/ansi.rs +++ b/alacritty_terminal/src/ansi.rs @@ -1155,7 +1155,7 @@ where } } -fn attrs_from_sgr_parameters(params: &mut ParamsIter) -> Vec> { +fn attrs_from_sgr_parameters(params: &mut ParamsIter<'_>) -> Vec> { let mut attrs = Vec::with_capacity(params.size_hint().0); while let Some(param) = params.next() { diff --git a/alacritty_terminal/src/lib.rs b/alacritty_terminal/src/lib.rs index 2f3beeb0..abeba531 100644 --- a/alacritty_terminal/src/lib.rs +++ b/alacritty_terminal/src/lib.rs @@ -1,6 +1,8 @@ //! Alacritty - The GPU Enhanced Terminal. +#![warn(rust_2018_idioms, future_incompatible)] #![deny(clippy::all, clippy::if_not_else, clippy::enum_glob_use, clippy::wrong_pub_self_convention)] +#![cfg_attr(feature = "cargo-clippy", deny(warnings))] #![cfg_attr(all(test, feature = "bench"), feature(test))] pub mod ansi;