remove some unwrap_unchecked

This commit is contained in:
2025-12-05 20:36:28 -05:00
parent 5480522ddb
commit b08a727fe3
2 changed files with 4 additions and 11 deletions

View File

@@ -489,13 +489,8 @@ impl App for MathApp {
.iter()
.map(|(_, func)| func.get_test_result())
.enumerate()
.filter(|(_, error)| error.is_some())
.map(|(i, error)| {
// use unwrap_unchecked as None Errors are already filtered out
unsafe {
format!("(Function #{}) {}\n", i, error.as_ref().unwrap_unchecked())
}
})
.filter_map(|(i, error)| error.as_ref().map(|x| (i, x)))
.map(|(i, error)| format!("(Function #{}) {}\n", i, error))
.join("");
if !errors_formatted.is_empty() {