Create ex4.rs

pull/16/merge
Carol (Nichols || Goulding) 9 years ago
parent fe7157f4de
commit 662c651c6f

@ -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),
}
}
Loading…
Cancel
Save