Skip to content

Commit 5885de1

Browse files
committed
lintcheck: clean up unwrap-handling a bit
1 parent d2a9917 commit 5885de1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clippy_dev/src/lintcheck.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#![cfg(feature = "lintcheck")]
88
#![allow(clippy::filter_map, clippy::collapsible_else_if)]
9+
#![allow(clippy::blocks_in_if_conditions)] // FP on `if x.iter().any(|x| ...)`
910

1011
use crate::clippy_project_root;
1112

@@ -330,8 +331,9 @@ impl LintcheckConfig {
330331
// by default use a single thread
331332
let max_jobs = match clap_config.value_of("threads") {
332333
Some(threads) => {
333-
let err_msg = format!("Failed to parse '{}' to a digit", threads);
334-
let threads: usize = threads.parse().expect(&err_msg);
334+
let threads: usize = threads
335+
.parse()
336+
.unwrap_or_else(|_| panic!("Failed to parse '{}' to a digit", threads));
335337
if threads == 0 {
336338
// automatic choice
337339
// Rayon seems to return thread count so half that for core count
@@ -751,9 +753,7 @@ fn lintcheck_test() {
751753
"lintcheck",
752754
"--",
753755
"lintcheck",
754-
//"--",
755756
"--crates-toml",
756-
//"--",
757757
"clippy_dev/ci_test_sources.toml",
758758
];
759759
let status = std::process::Command::new("cargo")

0 commit comments

Comments
 (0)