remove some unwrap_unchecked
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user