Skip to content

Commit

Permalink
Create ex4.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
carols10cents committed Sep 16, 2015
1 parent fe7157f commit 662c651
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ex4.rs
Original file line number Diff line number Diff line change
@@ -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),
}
}

0 comments on commit 662c651

Please sign in to comment.