Is there any way of doing unwrap_or_return an Error (any error)
问题 Is there any way to simplify the returns in the following example (originally copied from here): use std::num::ParseIntError; fn multiply(first_number_str: &str, second_number_str: &str) -> Result<i32, ParseIntError> { let first_number = match first_number_str.parse::<i32>() { Ok(first_number) => first_number, Err(e) => return Err(e), }; let second_number = match second_number_str.parse::<i32>() { Ok(second_number) => second_number, Err(e) => return Err(AnotherError::ParseError("error")), };