Skip to content

Commit e3210d9

Browse files
committed
Address nightly lints
1 parent 05b5be9 commit e3210d9

File tree

14 files changed

+26
-23
lines changed

14 files changed

+26
-23
lines changed

scripts/data/lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
)]
5353
// enable all of Clippy's lints
5454
#![deny(clippy::all, clippy::cargo, clippy::pedantic, clippy::restriction)]
55-
#![cfg_attr(include_nightly_lints, deny(clippy::nursery))]
5655
#![allow(
5756
clippy::arithmetic_side_effects,
5857
clippy::arithmetic_side_effects,
@@ -113,6 +112,7 @@
113112
#![cfg_attr(
114113
include_nightly_lints,
115114
allow(
115+
clippy::absolute_paths,
116116
clippy::arc_with_non_send_sync,
117117
clippy::min_ident_chars,
118118
clippy::needless_raw_strings,

src/config/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
)]
5454
// enable all of Clippy's lints
5555
#![deny(clippy::all, clippy::cargo, clippy::pedantic, clippy::restriction)]
56-
#![cfg_attr(include_nightly_lints, deny(clippy::nursery))]
5756
#![allow(
5857
clippy::arithmetic_side_effects,
5958
clippy::arithmetic_side_effects,
@@ -114,6 +113,7 @@
114113
#![cfg_attr(
115114
include_nightly_lints,
116115
allow(
116+
clippy::absolute_paths,
117117
clippy::arc_with_non_send_sync,
118118
clippy::min_ident_chars,
119119
clippy::needless_raw_strings,

src/core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
)]
5454
// enable all of Clippy's lints
5555
#![deny(clippy::all, clippy::cargo, clippy::pedantic, clippy::restriction)]
56-
#![cfg_attr(include_nightly_lints, deny(clippy::nursery))]
5756
#![allow(
5857
clippy::arithmetic_side_effects,
5958
clippy::arithmetic_side_effects,
@@ -114,6 +113,7 @@
114113
#![cfg_attr(
115114
include_nightly_lints,
116115
allow(
116+
clippy::absolute_paths,
117117
clippy::arc_with_non_send_sync,
118118
clippy::min_ident_chars,
119119
clippy::needless_raw_strings,

src/core/src/modules/show_commit/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,14 @@ impl Module for ShowCommit {
152152

153153
if handle_view_data_scroll(event, view_state).is_none() {
154154
match event {
155-
Event::MetaEvent(meta_event) if meta_event == MetaEvent::ShowDiff => {
155+
Event::MetaEvent(MetaEvent::ShowDiff) => {
156156
active_view_data.update_view_data(|updater| updater.clear());
157157
self.state = match self.state {
158158
ShowCommitState::Overview => ShowCommitState::Diff,
159159
ShowCommitState::Diff => ShowCommitState::Overview,
160160
}
161161
},
162-
Event::Standard(standard_event) if standard_event == StandardEvent::Help => self.help.set_active(),
162+
Event::Standard(StandardEvent::Help) => self.help.set_active(),
163163
Event::Key(_) => {
164164
active_view_data.update_view_data(|updater| updater.clear());
165165
if self.state == ShowCommitState::Diff {

src/core/src/util.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ macro_rules! first {
4040
#[must_use]
4141
pub(crate) fn handle_view_data_scroll(event: Event, view_state: &view::State) -> Option<Event> {
4242
match event {
43-
Event::Standard(meta_event) if meta_event == StandardEvent::ScrollLeft => view_state.scroll_left(),
44-
Event::Standard(meta_event) if meta_event == StandardEvent::ScrollRight => view_state.scroll_right(),
45-
Event::Standard(meta_event) if meta_event == StandardEvent::ScrollDown => view_state.scroll_down(),
46-
Event::Standard(meta_event) if meta_event == StandardEvent::ScrollUp => view_state.scroll_up(),
47-
Event::Standard(meta_event) if meta_event == StandardEvent::ScrollTop => view_state.scroll_top(),
48-
Event::Standard(meta_event) if meta_event == StandardEvent::ScrollBottom => view_state.scroll_bottom(),
49-
Event::Standard(meta_event) if meta_event == StandardEvent::ScrollJumpDown => view_state.scroll_page_down(),
50-
Event::Standard(meta_event) if meta_event == StandardEvent::ScrollJumpUp => view_state.scroll_page_up(),
43+
Event::Standard(StandardEvent::ScrollLeft) => view_state.scroll_left(),
44+
Event::Standard(StandardEvent::ScrollRight) => view_state.scroll_right(),
45+
Event::Standard(StandardEvent::ScrollDown) => view_state.scroll_down(),
46+
Event::Standard(StandardEvent::ScrollUp) => view_state.scroll_up(),
47+
Event::Standard(StandardEvent::ScrollTop) => view_state.scroll_top(),
48+
Event::Standard(StandardEvent::ScrollBottom) => view_state.scroll_bottom(),
49+
Event::Standard(StandardEvent::ScrollJumpDown) => view_state.scroll_page_down(),
50+
Event::Standard(StandardEvent::ScrollJumpUp) => view_state.scroll_page_up(),
5151
_ => return None,
5252
};
5353
Some(event)
@@ -66,6 +66,8 @@ mod tests {
6666
#[case::scroll_right(StandardEvent::ScrollRight, "ScrollRight")]
6767
#[case::scroll_down(StandardEvent::ScrollDown, "ScrollDown")]
6868
#[case::scroll_up(StandardEvent::ScrollUp, "ScrollUp")]
69+
#[case::scroll_top(StandardEvent::ScrollTop, "ScrollTop")]
70+
#[case::scroll_bottom(StandardEvent::ScrollBottom, "ScrollBottom")]
6971
#[case::jump_down(StandardEvent::ScrollJumpDown, "PageDown")]
7072
#[case::jump_up(StandardEvent::ScrollJumpUp, "PageUp")]
7173
fn handle_view_data_scroll_event(#[case] meta_event: StandardEvent, #[case] action: &str) {

src/display/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
)]
5454
// enable all of Clippy's lints
5555
#![deny(clippy::all, clippy::cargo, clippy::pedantic, clippy::restriction)]
56-
#![cfg_attr(include_nightly_lints, deny(clippy::nursery))]
5756
#![allow(
5857
clippy::arithmetic_side_effects,
5958
clippy::arithmetic_side_effects,
@@ -114,6 +113,7 @@
114113
#![cfg_attr(
115114
include_nightly_lints,
116115
allow(
116+
clippy::absolute_paths,
117117
clippy::arc_with_non_send_sync,
118118
clippy::min_ident_chars,
119119
clippy::needless_raw_strings,

src/git/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
)]
5454
// enable all of Clippy's lints
5555
#![deny(clippy::all, clippy::cargo, clippy::pedantic, clippy::restriction)]
56-
#![cfg_attr(include_nightly_lints, deny(clippy::nursery))]
5756
#![allow(
5857
clippy::arithmetic_side_effects,
5958
clippy::arithmetic_side_effects,
@@ -114,6 +113,7 @@
114113
#![cfg_attr(
115114
include_nightly_lints,
116115
allow(
116+
clippy::absolute_paths,
117117
clippy::arc_with_non_send_sync,
118118
clippy::min_ident_chars,
119119
clippy::needless_raw_strings,

src/git/src/repository.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::{
2+
fmt::{Debug, Formatter},
23
path::{Path, PathBuf},
34
sync::Arc,
45
};
@@ -176,9 +177,9 @@ impl From<git2::Repository> for Repository {
176177
}
177178
}
178179

179-
impl std::fmt::Debug for Repository {
180+
impl Debug for Repository {
180181
#[inline]
181-
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
182+
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), std::fmt::Error> {
182183
f.debug_struct("Repository")
183184
.field("[path]", &self.repository.lock().path())
184185
.finish()

src/input/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
)]
5454
// enable all of Clippy's lints
5555
#![deny(clippy::all, clippy::cargo, clippy::pedantic, clippy::restriction)]
56-
#![cfg_attr(include_nightly_lints, deny(clippy::nursery))]
5756
#![allow(
5857
clippy::arithmetic_side_effects,
5958
clippy::arithmetic_side_effects,
@@ -114,6 +113,7 @@
114113
#![cfg_attr(
115114
include_nightly_lints,
116115
allow(
116+
clippy::absolute_paths,
117117
clippy::arc_with_non_send_sync,
118118
clippy::min_ident_chars,
119119
clippy::needless_raw_strings,

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
)]
5454
// enable all of Clippy's lints
5555
#![deny(clippy::all, clippy::cargo, clippy::pedantic, clippy::restriction)]
56-
#![cfg_attr(include_nightly_lints, deny(clippy::nursery))]
5756
#![allow(
5857
clippy::arithmetic_side_effects,
5958
clippy::arithmetic_side_effects,
@@ -114,6 +113,7 @@
114113
#![cfg_attr(
115114
include_nightly_lints,
116115
allow(
116+
clippy::absolute_paths,
117117
clippy::arc_with_non_send_sync,
118118
clippy::min_ident_chars,
119119
clippy::needless_raw_strings,

0 commit comments

Comments
 (0)