1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2025-03-10 17:17:19 -04:00

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'.
This commit is contained in:
Kirill Chibisov 2020-10-29 07:17:33 +03:00 committed by GitHub
parent 598684243b
commit a99a9fd84c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 6 deletions

View file

@ -898,8 +898,8 @@ impl<N: Notify + OnResize> Processor<N> {
/// ///
/// Doesn't take self mutably due to borrow checking. /// Doesn't take self mutably due to borrow checking.
fn handle_event<T>( fn handle_event<T>(
event: GlutinEvent<Event>, event: GlutinEvent<'_, Event>,
processor: &mut input::Processor<T, ActionContext<N, T>>, processor: &mut input::Processor<'_, T, ActionContext<'_, N, T>>,
) where ) where
T: EventListener, T: EventListener,
{ {
@ -1044,7 +1044,7 @@ impl<N: Notify + OnResize> Processor<N> {
} }
/// Check if an event is irrelevant and can be skipped. /// Check if an event is irrelevant and can be skipped.
fn skip_event(event: &GlutinEvent<Event>) -> bool { fn skip_event(event: &GlutinEvent<'_, Event>) -> bool {
match event { match event {
GlutinEvent::WindowEvent { event, .. } => matches!( GlutinEvent::WindowEvent { event, .. } => matches!(
event, event,
@ -1066,8 +1066,10 @@ impl<N: Notify + OnResize> Processor<N> {
} }
} }
fn reload_config<T>(path: &PathBuf, processor: &mut input::Processor<T, ActionContext<N, T>>) fn reload_config<T>(
where path: &PathBuf,
processor: &mut input::Processor<'_, T, ActionContext<'_, N, T>>,
) where
T: EventListener, T: EventListener,
{ {
if !processor.ctx.message_buffer.is_empty() { if !processor.ctx.message_buffer.is_empty() {

View file

@ -1,6 +1,8 @@
//! Alacritty - The GPU Enhanced Terminal. //! 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)] #![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))] #![cfg_attr(all(test, feature = "bench"), feature(test))]
// With the default subsystem, 'console', windows creates an additional console // With the default subsystem, 'console', windows creates an additional console
// window for the program. // window for the program.

View file

@ -1155,7 +1155,7 @@ where
} }
} }
fn attrs_from_sgr_parameters(params: &mut ParamsIter) -> Vec<Option<Attr>> { fn attrs_from_sgr_parameters(params: &mut ParamsIter<'_>) -> Vec<Option<Attr>> {
let mut attrs = Vec::with_capacity(params.size_hint().0); let mut attrs = Vec::with_capacity(params.size_hint().0);
while let Some(param) = params.next() { while let Some(param) = params.next() {

View file

@ -1,6 +1,8 @@
//! Alacritty - The GPU Enhanced Terminal. //! 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)] #![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))] #![cfg_attr(all(test, feature = "bench"), feature(test))]
pub mod ansi; pub mod ansi;