From e3210d934c90784755d1afaee1d8f2ea2eee21bc Mon Sep 17 00:00:00 2001 From: Tim Oram Date: Mon, 7 Aug 2023 11:38:42 -0230 Subject: Address nightly lints --- scripts/data/lints.rs | 2 +- src/config/src/lib.rs | 2 +- src/core/src/lib.rs | 2 +- src/core/src/modules/show_commit/mod.rs | 4 ++-- src/core/src/util.rs | 18 ++++++++++-------- src/display/src/lib.rs | 2 +- src/git/src/lib.rs | 2 +- src/git/src/repository.rs | 5 +++-- src/input/src/lib.rs | 2 +- src/main.rs | 2 +- src/runtime/src/lib.rs | 2 +- src/testutils/src/lib.rs | 2 +- src/todo_file/src/lib.rs | 2 +- src/view/src/lib.rs | 2 +- 14 files changed, 26 insertions(+), 23 deletions(-) diff --git a/scripts/data/lints.rs b/scripts/data/lints.rs index b33c70f..8ab2ba9 100644 --- a/scripts/data/lints.rs +++ b/scripts/data/lints.rs @@ -52,7 +52,6 @@ )] // enable all of Clippy's lints #![deny(clippy::all, clippy::cargo, clippy::pedantic, clippy::restriction)] -#![cfg_attr(include_nightly_lints, deny(clippy::nursery))] #![allow( clippy::arithmetic_side_effects, clippy::arithmetic_side_effects, @@ -113,6 +112,7 @@ #![cfg_attr( include_nightly_lints, allow( + clippy::absolute_paths, clippy::arc_with_non_send_sync, clippy::min_ident_chars, clippy::needless_raw_strings, diff --git a/src/config/src/lib.rs b/src/config/src/lib.rs index 36d527d..3ee2b66 100644 --- a/src/config/src/lib.rs +++ b/src/config/src/lib.rs @@ -53,7 +53,6 @@ )] // enable all of Clippy's lints #![deny(clippy::all, clippy::cargo, clippy::pedantic, clippy::restriction)] -#![cfg_attr(include_nightly_lints, deny(clippy::nursery))] #![allow( clippy::arithmetic_side_effects, clippy::arithmetic_side_effects, @@ -114,6 +113,7 @@ #![cfg_attr( include_nightly_lints, allow( + clippy::absolute_paths, clippy::arc_with_non_send_sync, clippy::min_ident_chars, clippy::needless_raw_strings, diff --git a/src/core/src/lib.rs b/src/core/src/lib.rs index 4622bc3..b54f875 100644 --- a/src/core/src/lib.rs +++ b/src/core/src/lib.rs @@ -53,7 +53,6 @@ )] // enable all of Clippy's lints #![deny(clippy::all, clippy::cargo, clippy::pedantic, clippy::restriction)] -#![cfg_attr(include_nightly_lints, deny(clippy::nursery))] #![allow( clippy::arithmetic_side_effects, clippy::arithmetic_side_effects, @@ -114,6 +113,7 @@ #![cfg_attr( include_nightly_lints, allow( + clippy::absolute_paths, clippy::arc_with_non_send_sync, clippy::min_ident_chars, clippy::needless_raw_strings, diff --git a/src/core/src/modules/show_commit/mod.rs b/src/core/src/modules/show_commit/mod.rs index b4620a2..6c281b5 100644 --- a/src/core/src/modules/show_commit/mod.rs +++ b/src/core/src/modules/show_commit/mod.rs @@ -152,14 +152,14 @@ impl Module for ShowCommit { if handle_view_data_scroll(event, view_state).is_none() { match event { - Event::MetaEvent(meta_event) if meta_event == MetaEvent::ShowDiff => { + Event::MetaEvent(MetaEvent::ShowDiff) => { active_view_data.update_view_data(|updater| updater.clear()); self.state = match self.state { ShowCommitState::Overview => ShowCommitState::Diff, ShowCommitState::Diff => ShowCommitState::Overview, } }, - Event::Standard(standard_event) if standard_event == StandardEvent::Help => self.help.set_active(), + Event::Standard(StandardEvent::Help) => self.help.set_active(), Event::Key(_) => { active_view_data.update_view_data(|updater| updater.clear()); if self.state == ShowCommitState::Diff { diff --git a/src/core/src/util.rs b/src/core/src/util.rs index 2c4a96c..9591d21 100644 --- a/src/core/src/util.rs +++ b/src/core/src/util.rs @@ -40,14 +40,14 @@ macro_rules! first { #[must_use] pub(crate) fn handle_view_data_scroll(event: Event, view_state: &view::State) -> Option { match event { - Event::Standard(meta_event) if meta_event == StandardEvent::ScrollLeft => view_state.scroll_left(), - Event::Standard(meta_event) if meta_event == StandardEvent::ScrollRight => view_state.scroll_right(), - Event::Standard(meta_event) if meta_event == StandardEvent::ScrollDown => view_state.scroll_down(), - Event::Standard(meta_event) if meta_event == StandardEvent::ScrollUp => view_state.scroll_up(), - Event::Standard(meta_event) if meta_event == StandardEvent::ScrollTop => view_state.scroll_top(), - Event::Standard(meta_event) if meta_event == StandardEvent::ScrollBottom => view_state.scroll_bottom(), - Event::Standard(meta_event) if meta_event == StandardEvent::ScrollJumpDown => view_state.scroll_page_down(), - Event::Standard(meta_event) if meta_event == StandardEvent::ScrollJumpUp => view_state.scroll_page_up(), + Event::Standard(StandardEvent::ScrollLeft) => view_state.scroll_left(), + Event::Standard(StandardEvent::ScrollRight) => view_state.scroll_right(), + Event::Standard(StandardEvent::ScrollDown) => view_state.scroll_down(), + Event::Standard(StandardEvent::ScrollUp) => view_state.scroll_up(), + Event::Standard(StandardEvent::ScrollTop) => view_state.scroll_top(), + Event::Standard(StandardEvent::ScrollBottom) => view_state.scroll_bottom(), + Event::Standard(StandardEvent::ScrollJumpDown) => view_state.scroll_page_down(), + Event::Standard(StandardEvent::ScrollJumpUp) => view_state.scroll_page_up(), _ => return None, }; Some(event) @@ -66,6 +66,8 @@ mod tests { #[case::scroll_right(StandardEvent::ScrollRight, "ScrollRight")] #[case::scroll_down(StandardEvent::ScrollDown, "ScrollDown")] #[case::scroll_up(StandardEvent::ScrollUp, "ScrollUp")] + #[case::scroll_top(StandardEvent::ScrollTop, "ScrollTop")] + #[case::scroll_bottom(StandardEvent::ScrollBottom, "ScrollBottom")] #[case::jump_down(StandardEvent::ScrollJumpDown, "PageDown")] #[case::jump_up(StandardEvent::ScrollJumpUp, "PageUp")] fn handle_view_data_scroll_event(#[case] meta_event: StandardEvent, #[case] action: &str) { diff --git a/src/display/src/lib.rs b/src/display/src/lib.rs index 741d562..e31a7e5 100644 --- a/src/display/src/lib.rs +++ b/src/display/src/lib.rs @@ -53,7 +53,6 @@ )] // enable all of Clippy's lints #![deny(clippy::all, clippy::cargo, clippy::pedantic, clippy::restriction)] -#![cfg_attr(include_nightly_lints, deny(clippy::nursery))] #![allow( clippy::arithmetic_side_effects, clippy::arithmetic_side_effects, @@ -114,6 +113,7 @@ #![cfg_attr( include_nightly_lints, allow( + clippy::absolute_paths, clippy::arc_with_non_send_sync, clippy::min_ident_chars, clippy::needless_raw_strings, diff --git a/src/git/src/lib.rs b/src/git/src/lib.rs index bcbb18a..caa932e 100644 --- a/src/git/src/lib.rs +++ b/src/git/src/lib.rs @@ -53,7 +53,6 @@ )] // enable all of Clippy's lints #![deny(clippy::all, clippy::cargo, clippy::pedantic, clippy::restriction)] -#![cfg_attr(include_nightly_lints, deny(clippy::nursery))] #![allow( clippy::arithmetic_side_effects, clippy::arithmetic_side_effects, @@ -114,6 +113,7 @@ #![cfg_attr( include_nightly_lints, allow( + clippy::absolute_paths, clippy::arc_with_non_send_sync, clippy::min_ident_chars, clippy::needless_raw_strings, diff --git a/src/git/src/repository.rs b/src/git/src/repository.rs index 2133acb..85e3ad1 100644 --- a/src/git/src/repository.rs +++ b/src/git/src/repository.rs @@ -1,4 +1,5 @@ use std::{ + fmt::{Debug, Formatter}, path::{Path, PathBuf}, sync::Arc, }; @@ -176,9 +177,9 @@ impl From for Repository { } } -impl std::fmt::Debug for Repository { +impl Debug for Repository { #[inline] - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), std::fmt::Error> { f.debug_struct("Repository") .field("[path]", &self.repository.lock().path()) .finish() diff --git a/src/input/src/lib.rs b/src/input/src/lib.rs index 85cc2e9..00b0929 100644 --- a/src/input/src/lib.rs +++ b/src/input/src/lib.rs @@ -53,7 +53,6 @@ )] // enable all of Clippy's lints #![deny(clippy::all, clippy::cargo, clippy::pedantic, clippy::restriction)] -#![cfg_attr(include_nightly_lints, deny(clippy::nursery))] #![allow( clippy::arithmetic_side_effects, clippy::arithmetic_side_effects, @@ -114,6 +113,7 @@ #![cfg_attr( include_nightly_lints, allow( + clippy::absolute_paths, clippy::arc_with_non_send_sync, clippy::min_ident_chars, clippy::needless_raw_strings, diff --git a/src/main.rs b/src/main.rs index 99ff1a6..085b660 100644 --- a/src/main.rs +++ b/src/main.rs @@ -53,7 +53,6 @@ )] // enable all of Clippy's lints #![deny(clippy::all, clippy::cargo, clippy::pedantic, clippy::restriction)] -#![cfg_attr(include_nightly_lints, deny(clippy::nursery))] #![allow( clippy::arithmetic_side_effects, clippy::arithmetic_side_effects, @@ -114,6 +113,7 @@ #![cfg_attr( include_nightly_lints, allow( + clippy::absolute_paths, clippy::arc_with_non_send_sync, clippy::min_ident_chars, clippy::needless_raw_strings, diff --git a/src/runtime/src/lib.rs b/src/runtime/src/lib.rs index a7197d6..7ba30e0 100644 --- a/src/runtime/src/lib.rs +++ b/src/runtime/src/lib.rs @@ -53,7 +53,6 @@ )] // enable all of Clippy's lints #![deny(clippy::all, clippy::cargo, clippy::pedantic, clippy::restriction)] -#![cfg_attr(include_nightly_lints, deny(clippy::nursery))] #![allow( clippy::arithmetic_side_effects, clippy::arithmetic_side_effects, @@ -114,6 +113,7 @@ #![cfg_attr( include_nightly_lints, allow( + clippy::absolute_paths, clippy::arc_with_non_send_sync, clippy::min_ident_chars, clippy::needless_raw_strings, diff --git a/src/testutils/src/lib.rs b/src/testutils/src/lib.rs index 38bf351..648e85b 100644 --- a/src/testutils/src/lib.rs +++ b/src/testutils/src/lib.rs @@ -53,7 +53,6 @@ )] // enable all of Clippy's lints #![deny(clippy::all, clippy::cargo, clippy::pedantic, clippy::restriction)] -#![cfg_attr(include_nightly_lints, deny(clippy::nursery))] #![allow( clippy::arithmetic_side_effects, clippy::arithmetic_side_effects, @@ -114,6 +113,7 @@ #![cfg_attr( include_nightly_lints, allow( + clippy::absolute_paths, clippy::arc_with_non_send_sync, clippy::min_ident_chars, clippy::needless_raw_strings, diff --git a/src/todo_file/src/lib.rs b/src/todo_file/src/lib.rs index 77fbd87..dc7632e 100644 --- a/src/todo_file/src/lib.rs +++ b/src/todo_file/src/lib.rs @@ -53,7 +53,6 @@ )] // enable all of Clippy's lints #![deny(clippy::all, clippy::cargo, clippy::pedantic, clippy::restriction)] -#![cfg_attr(include_nightly_lints, deny(clippy::nursery))] #![allow( clippy::arithmetic_side_effects, clippy::arithmetic_side_effects, @@ -114,6 +113,7 @@ #![cfg_attr( include_nightly_lints, allow( + clippy::absolute_paths, clippy::arc_with_non_send_sync, clippy::min_ident_chars, clippy::needless_raw_strings, diff --git a/src/view/src/lib.rs b/src/view/src/lib.rs index 46019d3..7891aa5 100644 --- a/src/view/src/lib.rs +++ b/src/view/src/lib.rs @@ -53,7 +53,6 @@ )] // enable all of Clippy's lints #![deny(clippy::all, clippy::cargo, clippy::pedantic, clippy::restriction)] -#![cfg_attr(include_nightly_lints, deny(clippy::nursery))] #![allow( clippy::arithmetic_side_effects, clippy::arithmetic_side_effects, @@ -114,6 +113,7 @@ #![cfg_attr( include_nightly_lints, allow( + clippy::absolute_paths, clippy::arc_with_non_send_sync, clippy::min_ident_chars, clippy::needless_raw_strings, -- cgit v1.2.3