From 662c651c6fecbcb32fc63323f1d257d60b51bff8 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Tue, 15 Sep 2015 20:29:05 -0400 Subject: [PATCH] Create ex4.rs --- ex4.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 ex4.rs diff --git a/ex4.rs b/ex4.rs new file mode 100644 index 0000000..d1ae563 --- /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), + } +}