Ban all unwrap usage in codebase

This commit is contained in:
topjohnwu
2025-12-08 23:31:04 -08:00
committed by John Wu
parent 200665c48a
commit ff4ca74cfe
24 changed files with 138 additions and 89 deletions
+3 -7
View File
@@ -132,13 +132,9 @@ impl PositionalArgParser<'_> {
}
fn ensure_end(&mut self) -> Result<(), EarlyExit> {
if self.0.len() == 0 {
Ok(())
} else {
Err(EarlyExit::from(format!(
"Unrecognized argument: {}\n",
self.0.next().unwrap()
)))
match self.0.next() {
None => Ok(()),
Some(s) => Err(EarlyExit::from(format!("Unrecognized argument: {s}\n"))),
}
}
}