mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
Simplify threads field unwrapping
This commit is contained in:
parent
bdd4d8f899
commit
00e7d792b9
1 changed files with 1 additions and 5 deletions
|
|
@ -576,11 +576,7 @@ impl Downloader {
|
||||||
};
|
};
|
||||||
|
|
||||||
// If `threads` is specified, use that many CPU cores(?).
|
// If `threads` is specified, use that many CPU cores(?).
|
||||||
let cpus = if let Some(threads) = self.threads {
|
let cpus = self.threads.unwrap_or(num_cpus::get());
|
||||||
threads
|
|
||||||
} else {
|
|
||||||
num_cpus::get()
|
|
||||||
};
|
|
||||||
let mut segs: Vec<Vec<VariantSegment>> = Vec::with_capacity(cpus);
|
let mut segs: Vec<Vec<VariantSegment>> = Vec::with_capacity(cpus);
|
||||||
for _ in 0..cpus {
|
for _ in 0..cpus {
|
||||||
segs.push(vec![])
|
segs.push(vec![])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue