diff options
Diffstat (limited to 'ex4.rs')
| -rw-r--r-- | ex4.rs | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -0,0 +1,13 @@ +// Make me compile! + +fn something() -> Result<i32, std::num::ParseIntError> { + let x:i32 = "3".parse(); + Ok(x * 4) +} + +fn main() { + match something() { + Ok(..) => println!("You win!"), + Err(e) => println!("Oh no something went wrong: {}", e), + } +} |
