Skip to content

Commit d765515

Browse files
committed
Fix latest linting errors
1 parent 7d324c2 commit d765515

File tree

14 files changed

+84
-139
lines changed

14 files changed

+84
-139
lines changed

scripts/data/lints.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,23 @@
6464
clippy::implicit_return,
6565
clippy::indexing_slicing,
6666
clippy::map_err_ignore,
67+
clippy::min_ident_chars,
6768
clippy::missing_docs_in_private_items,
6869
clippy::missing_trait_methods,
6970
clippy::mod_module_files,
7071
clippy::module_name_repetitions,
72+
clippy::needless_raw_strings,
7173
clippy::new_without_default,
7274
clippy::non_ascii_literal,
7375
clippy::option_if_let_else,
76+
clippy::pattern_type_mismatch,
7477
clippy::pub_use,
78+
clippy::pub_with_shorthand,
7579
clippy::question_mark_used,
80+
clippy::redundant_closure_call,
7681
clippy::redundant_pub_crate,
7782
clippy::ref_patterns,
83+
clippy::single_call_fn,
7884
clippy::std_instead_of_alloc,
7985
clippy::std_instead_of_core,
8086
clippy::tabs_in_doc_comments,
@@ -109,15 +115,4 @@
109115
)
110116
)]
111117
// allowable upcoming nightly lints
112-
#![cfg_attr(
113-
include_nightly_lints,
114-
allow(
115-
clippy::absolute_paths,
116-
clippy::arc_with_non_send_sync,
117-
clippy::min_ident_chars,
118-
clippy::needless_raw_strings,
119-
clippy::pub_with_shorthand,
120-
clippy::redundant_closure_call,
121-
clippy::single_call_fn
122-
)
123-
)]
118+
#![cfg_attr(include_nightly_lints, allow(clippy::absolute_paths, clippy::arc_with_non_send_sync))]

src/config/src/lib.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,23 @@
6565
clippy::implicit_return,
6666
clippy::indexing_slicing,
6767
clippy::map_err_ignore,
68+
clippy::min_ident_chars,
6869
clippy::missing_docs_in_private_items,
6970
clippy::missing_trait_methods,
7071
clippy::mod_module_files,
7172
clippy::module_name_repetitions,
73+
clippy::needless_raw_strings,
7274
clippy::new_without_default,
7375
clippy::non_ascii_literal,
7476
clippy::option_if_let_else,
77+
clippy::pattern_type_mismatch,
7578
clippy::pub_use,
79+
clippy::pub_with_shorthand,
7680
clippy::question_mark_used,
81+
clippy::redundant_closure_call,
7782
clippy::redundant_pub_crate,
7883
clippy::ref_patterns,
84+
clippy::single_call_fn,
7985
clippy::std_instead_of_alloc,
8086
clippy::std_instead_of_core,
8187
clippy::tabs_in_doc_comments,
@@ -110,18 +116,7 @@
110116
)
111117
)]
112118
// allowable upcoming nightly lints
113-
#![cfg_attr(
114-
include_nightly_lints,
115-
allow(
116-
clippy::absolute_paths,
117-
clippy::arc_with_non_send_sync,
118-
clippy::min_ident_chars,
119-
clippy::needless_raw_strings,
120-
clippy::pub_with_shorthand,
121-
clippy::redundant_closure_call,
122-
clippy::single_call_fn
123-
)
124-
)]
119+
#![cfg_attr(include_nightly_lints, allow(clippy::absolute_paths, clippy::arc_with_non_send_sync))]
125120
// LINT-REPLACE-END
126121

127122
//! Git Interactive Rebase Tool - Configuration Module

src/core/src/lib.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,23 @@
6565
clippy::implicit_return,
6666
clippy::indexing_slicing,
6767
clippy::map_err_ignore,
68+
clippy::min_ident_chars,
6869
clippy::missing_docs_in_private_items,
6970
clippy::missing_trait_methods,
7071
clippy::mod_module_files,
7172
clippy::module_name_repetitions,
73+
clippy::needless_raw_strings,
7274
clippy::new_without_default,
7375
clippy::non_ascii_literal,
7476
clippy::option_if_let_else,
77+
clippy::pattern_type_mismatch,
7578
clippy::pub_use,
79+
clippy::pub_with_shorthand,
7680
clippy::question_mark_used,
81+
clippy::redundant_closure_call,
7782
clippy::redundant_pub_crate,
7883
clippy::ref_patterns,
84+
clippy::single_call_fn,
7985
clippy::std_instead_of_alloc,
8086
clippy::std_instead_of_core,
8187
clippy::tabs_in_doc_comments,
@@ -110,18 +116,7 @@
110116
)
111117
)]
112118
// allowable upcoming nightly lints
113-
#![cfg_attr(
114-
include_nightly_lints,
115-
allow(
116-
clippy::absolute_paths,
117-
clippy::arc_with_non_send_sync,
118-
clippy::min_ident_chars,
119-
clippy::needless_raw_strings,
120-
clippy::pub_with_shorthand,
121-
clippy::redundant_closure_call,
122-
clippy::single_call_fn
123-
)
124-
)]
119+
#![cfg_attr(include_nightly_lints, allow(clippy::absolute_paths, clippy::arc_with_non_send_sync))]
125120
// LINT-REPLACE-END
126121
// TODO deny clippy::same_name_method again once bitflags/bitflags#374 is merged
127122
#![allow(

src/core/src/modules/external_editor/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl Module for ExternalEditor {
102102
let mut todo_file = self.todo_file.lock();
103103
let result = todo_file.load_file();
104104
let state = match result {
105-
Ok(_) => {
105+
Ok(()) => {
106106
if todo_file.is_empty() || todo_file.is_noop() {
107107
Some(ExternalEditorState::Empty)
108108
}

src/display/src/lib.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,23 @@
6565
clippy::implicit_return,
6666
clippy::indexing_slicing,
6767
clippy::map_err_ignore,
68+
clippy::min_ident_chars,
6869
clippy::missing_docs_in_private_items,
6970
clippy::missing_trait_methods,
7071
clippy::mod_module_files,
7172
clippy::module_name_repetitions,
73+
clippy::needless_raw_strings,
7274
clippy::new_without_default,
7375
clippy::non_ascii_literal,
7476
clippy::option_if_let_else,
77+
clippy::pattern_type_mismatch,
7578
clippy::pub_use,
79+
clippy::pub_with_shorthand,
7680
clippy::question_mark_used,
81+
clippy::redundant_closure_call,
7782
clippy::redundant_pub_crate,
7883
clippy::ref_patterns,
84+
clippy::single_call_fn,
7985
clippy::std_instead_of_alloc,
8086
clippy::std_instead_of_core,
8187
clippy::tabs_in_doc_comments,
@@ -110,18 +116,7 @@
110116
)
111117
)]
112118
// allowable upcoming nightly lints
113-
#![cfg_attr(
114-
include_nightly_lints,
115-
allow(
116-
clippy::absolute_paths,
117-
clippy::arc_with_non_send_sync,
118-
clippy::min_ident_chars,
119-
clippy::needless_raw_strings,
120-
clippy::pub_with_shorthand,
121-
clippy::redundant_closure_call,
122-
clippy::single_call_fn
123-
)
124-
)]
119+
#![cfg_attr(include_nightly_lints, allow(clippy::absolute_paths, clippy::arc_with_non_send_sync))]
125120
// LINT-REPLACE-END
126121

127122
//! Git Interactive Rebase Tool - Display Module

src/git/src/file_status_builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,15 +242,15 @@ mod tests {
242242
}
243243

244244
#[test]
245-
#[should_panic]
245+
#[should_panic(expected = "add_file_stat must be called once before adding a delta")]
246246
fn add_delta_without_file_stat() {
247247
let mut file_stats_builder = FileStatusBuilder::new();
248248
file_stats_builder.add_delta(Delta::new("@ path/to/file.rs:56 @ impl Delta {", 10, 12, 3, 4));
249249
_ = file_stats_builder.build();
250250
}
251251

252252
#[test]
253-
#[should_panic]
253+
#[should_panic(expected = "add_delta must be called once before adding a diff line")]
254254
fn add_diff_line_before_delta() {
255255
let mut file_stats_builder = FileStatusBuilder::new();
256256
file_stats_builder.add_file_stat(FileStatus::new(

src/git/src/lib.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,23 @@
6565
clippy::implicit_return,
6666
clippy::indexing_slicing,
6767
clippy::map_err_ignore,
68+
clippy::min_ident_chars,
6869
clippy::missing_docs_in_private_items,
6970
clippy::missing_trait_methods,
7071
clippy::mod_module_files,
7172
clippy::module_name_repetitions,
73+
clippy::needless_raw_strings,
7274
clippy::new_without_default,
7375
clippy::non_ascii_literal,
7476
clippy::option_if_let_else,
77+
clippy::pattern_type_mismatch,
7578
clippy::pub_use,
79+
clippy::pub_with_shorthand,
7680
clippy::question_mark_used,
81+
clippy::redundant_closure_call,
7782
clippy::redundant_pub_crate,
7883
clippy::ref_patterns,
84+
clippy::single_call_fn,
7985
clippy::std_instead_of_alloc,
8086
clippy::std_instead_of_core,
8187
clippy::tabs_in_doc_comments,
@@ -110,18 +116,7 @@
110116
)
111117
)]
112118
// allowable upcoming nightly lints
113-
#![cfg_attr(
114-
include_nightly_lints,
115-
allow(
116-
clippy::absolute_paths,
117-
clippy::arc_with_non_send_sync,
118-
clippy::min_ident_chars,
119-
clippy::needless_raw_strings,
120-
clippy::pub_with_shorthand,
121-
clippy::redundant_closure_call,
122-
clippy::single_call_fn
123-
)
124-
)]
119+
#![cfg_attr(include_nightly_lints, allow(clippy::absolute_paths, clippy::arc_with_non_send_sync))]
125120
// LINT-REPLACE-END
126121

127122
//! Git Interactive Rebase Tool - Git Module

src/input/src/lib.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,23 @@
6565
clippy::implicit_return,
6666
clippy::indexing_slicing,
6767
clippy::map_err_ignore,
68+
clippy::min_ident_chars,
6869
clippy::missing_docs_in_private_items,
6970
clippy::missing_trait_methods,
7071
clippy::mod_module_files,
7172
clippy::module_name_repetitions,
73+
clippy::needless_raw_strings,
7274
clippy::new_without_default,
7375
clippy::non_ascii_literal,
7476
clippy::option_if_let_else,
77+
clippy::pattern_type_mismatch,
7578
clippy::pub_use,
79+
clippy::pub_with_shorthand,
7680
clippy::question_mark_used,
81+
clippy::redundant_closure_call,
7782
clippy::redundant_pub_crate,
7883
clippy::ref_patterns,
84+
clippy::single_call_fn,
7985
clippy::std_instead_of_alloc,
8086
clippy::std_instead_of_core,
8187
clippy::tabs_in_doc_comments,
@@ -110,18 +116,7 @@
110116
)
111117
)]
112118
// allowable upcoming nightly lints
113-
#![cfg_attr(
114-
include_nightly_lints,
115-
allow(
116-
clippy::absolute_paths,
117-
clippy::arc_with_non_send_sync,
118-
clippy::min_ident_chars,
119-
clippy::needless_raw_strings,
120-
clippy::pub_with_shorthand,
121-
clippy::redundant_closure_call,
122-
clippy::single_call_fn
123-
)
124-
)]
119+
#![cfg_attr(include_nightly_lints, allow(clippy::absolute_paths, clippy::arc_with_non_send_sync))]
125120
// LINT-REPLACE-END
126121
// TODO deny clippy::same_name_method again once bitflags/bitflags#374 is merged
127122
#![allow(clippy::same_name_method)]

src/main.rs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,23 @@
6565
clippy::implicit_return,
6666
clippy::indexing_slicing,
6767
clippy::map_err_ignore,
68+
clippy::min_ident_chars,
6869
clippy::missing_docs_in_private_items,
6970
clippy::missing_trait_methods,
7071
clippy::mod_module_files,
7172
clippy::module_name_repetitions,
73+
clippy::needless_raw_strings,
7274
clippy::new_without_default,
7375
clippy::non_ascii_literal,
7476
clippy::option_if_let_else,
77+
clippy::pattern_type_mismatch,
7578
clippy::pub_use,
79+
clippy::pub_with_shorthand,
7680
clippy::question_mark_used,
81+
clippy::redundant_closure_call,
7782
clippy::redundant_pub_crate,
7883
clippy::ref_patterns,
84+
clippy::single_call_fn,
7985
clippy::std_instead_of_alloc,
8086
clippy::std_instead_of_core,
8187
clippy::tabs_in_doc_comments,
@@ -110,30 +116,19 @@
110116
)
111117
)]
112118
// allowable upcoming nightly lints
113-
#![cfg_attr(
114-
include_nightly_lints,
115-
allow(
116-
clippy::absolute_paths,
117-
clippy::arc_with_non_send_sync,
118-
clippy::min_ident_chars,
119-
clippy::needless_raw_strings,
120-
clippy::pub_with_shorthand,
121-
clippy::redundant_closure_call,
122-
clippy::single_call_fn
123-
)
124-
)]
119+
#![cfg_attr(include_nightly_lints, allow(clippy::absolute_paths, clippy::arc_with_non_send_sync))]
125120
// LINT-REPLACE-END
126121
#![allow(missing_docs, rustdoc::missing_crate_level_docs)]
127122

128-
use std::env::args_os;
123+
use std::{env, process};
129124

130125
// TODO use the termination trait once rust-lang/rust#43301 is stable
131126
#[allow(clippy::exit, clippy::print_stderr)]
132127
#[cfg(not(tarpaulin_include))]
133128
fn main() {
134-
let exit = core::run(args_os().skip(1).collect());
129+
let exit = core::run(env::args_os().skip(1).collect());
135130
if let Some(message) = exit.get_message().as_ref() {
136131
eprintln!("{message}");
137132
}
138-
std::process::exit(exit.get_status().to_code());
133+
process::exit(exit.get_status().to_code());
139134
}

src/runtime/src/lib.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,23 @@
6565
clippy::implicit_return,
6666
clippy::indexing_slicing,
6767
clippy::map_err_ignore,
68+
clippy::min_ident_chars,
6869
clippy::missing_docs_in_private_items,
6970
clippy::missing_trait_methods,
7071
clippy::mod_module_files,
7172
clippy::module_name_repetitions,
73+
clippy::needless_raw_strings,
7274
clippy::new_without_default,
7375
clippy::non_ascii_literal,
7476
clippy::option_if_let_else,
77+
clippy::pattern_type_mismatch,
7578
clippy::pub_use,
79+
clippy::pub_with_shorthand,
7680
clippy::question_mark_used,
81+
clippy::redundant_closure_call,
7782
clippy::redundant_pub_crate,
7883
clippy::ref_patterns,
84+
clippy::single_call_fn,
7985
clippy::std_instead_of_alloc,
8086
clippy::std_instead_of_core,
8187
clippy::tabs_in_doc_comments,
@@ -110,18 +116,7 @@
110116
)
111117
)]
112118
// allowable upcoming nightly lints
113-
#![cfg_attr(
114-
include_nightly_lints,
115-
allow(
116-
clippy::absolute_paths,
117-
clippy::arc_with_non_send_sync,
118-
clippy::min_ident_chars,
119-
clippy::needless_raw_strings,
120-
clippy::pub_with_shorthand,
121-
clippy::redundant_closure_call,
122-
clippy::single_call_fn
123-
)
124-
)]
119+
#![cfg_attr(include_nightly_lints, allow(clippy::absolute_paths, clippy::arc_with_non_send_sync))]
125120
// LINT-REPLACE-END
126121
#![allow(clippy::as_conversions, clippy::cast_possible_truncation)]
127122

0 commit comments

Comments
 (0)