Skip to content

Commit f00e5d8

Browse files
committed
refactor(process): remove redundant .context() in Process::concurrent_downloads()
1 parent 5fd42a6 commit f00e5d8

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/process.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,8 @@ impl Process {
188188
}
189189

190190
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-
}
191+
let s = self.var("RUSTUP_CONCURRENT_DOWNLOADS").ok()?;
192+
Some(NonZeroU64::from_str(&s).ok()?.get() as usize)
197193
}
198194
}
199195

0 commit comments

Comments
 (0)