diff --git a/ex4.rs b/ex4.rs new file mode 100644 index 00000000..d1ae563b --- /dev/null +++ b/ex4.rs @@ -0,0 +1,13 @@ +// Make me compile! + +fn something() -> Result { + 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), + } +}