diff options
| author | Carol (Nichols || Goulding) <carol.nichols@gmail.com> | 2015-09-15 20:29:05 -0400 |
|---|---|---|
| committer | Carol (Nichols || Goulding) <carol.nichols@gmail.com> | 2015-09-15 20:29:05 -0400 |
| commit | 662c651c6fecbcb32fc63323f1d257d60b51bff8 (patch) | |
| tree | 4a184205d278069e1bbfc7d25b4827c69a82b8d8 | |
| parent | fe7157f4de7548fa53ad2e7cb24104c50016f8bf (diff) | |
Create 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), + } +} |
