fn sum_str(a: &str, b: &str) -> Result> { let a = a.to_string().parse::()?; let b = b.to_string().parse::()?; Ok(a + b) } fn main() { let a = "a123"; let b = "456"; let sum = sum_str(a, b); if let Ok(s) = sum { println!("{} + {} = {}", a, b, s) } else { println!("Errore!") } }