fn low_square(x : u32) -> Result { let res = x*x; if res > 100 { return Err(()); } else { return Ok(res); } } fn main(){ let result = match low_square(5) { Ok(r) => r, Err(_) => { println!("The number was too high!"); panic!(); } }; println!("the answer is {}", result); let result = low_square(9).expect("The value given was too high!"); println!("Next answer: {}", result); println!("Another: {}", low_square(3).expect("Hippos")); }