Skip to content

Instantly share code, notes, and snippets.

@bstrie
Created November 9, 2012 16:12
Show Gist options
  • Select an option

  • Save bstrie/4046560 to your computer and use it in GitHub Desktop.

Select an option

Save bstrie/4046560 to your computer and use it in GitHub Desktop.
fn main() {
let bar = result_err();
match bar {
Ok(foo) => io::println(fmt!("Success: %?", foo)),
Err(foo) => fail foo.to_str()
}
}
fn result_ok() -> Result<int, int> {
Ok(0)
}
fn result_err() -> Result<int, int> {
Err(1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment