We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
.context()
Process::concurrent_downloads()
1 parent 5fd42a6 commit f00e5d8Copy full SHA for f00e5d8
src/process.rs
@@ -188,12 +188,8 @@ impl Process {
188
}
189
190
pub fn concurrent_downloads(&self) -> Option<usize> {
191
- match self.var("RUSTUP_CONCURRENT_DOWNLOADS") {
192
- Ok(s) => Some(NonZeroU64::from_str(&s).context(
193
- "invalid value in RUSTUP_CONCURRENT_DOWNLOADS -- must be a natural number greater than zero"
194
- ).ok()?.get() as usize),
195
- Err(_) => None,
196
- }
+ let s = self.var("RUSTUP_CONCURRENT_DOWNLOADS").ok()?;
+ Some(NonZeroU64::from_str(&s).ok()?.get() as usize)
197
198
199
0 commit comments