ok/jj
1
0
Fork 0
forked from mirrors/jj

clippy: fix a nightly clippy warning

This commit is contained in:
Ilya Grigoriev 2023-11-27 15:54:51 -08:00
parent 28ab9593c3
commit 3e96bf5372

View file

@ -58,9 +58,7 @@ pub fn cmd_run(ui: &mut Ui, command: &CommandHelper, args: &RunArgs) -> Result<(
let _jobs = match args.jobs { let _jobs = match args.jobs {
Some(0) => return Err(user_error("must pass at least one job")), Some(0) => return Err(user_error("must pass at least one job")),
Some(jobs) => Some(jobs), Some(jobs) => Some(jobs),
None => std::thread::available_parallelism() None => std::thread::available_parallelism().map(|t| t.into()).ok(),
.ok()
.and_then(|t| t.try_into().ok()),
} }
// Fallback to a single user-visible job. // Fallback to a single user-visible job.
.unwrap_or(1usize); .unwrap_or(1usize);