Skip to content

Instantly share code, notes, and snippets.

Created August 22, 2016 06:10
Show Gist options
  • Select an option

  • Save anonymous/a2501d1b27bbc42c0cbdcf39167ed164 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/a2501d1b27bbc42c0cbdcf39167ed164 to your computer and use it in GitHub Desktop.
Shared via Rust Playground
fn main() {
match failme() {
Err(e) => panic!(e),
_ => unreachable!()
}
}
fn failme() -> Result<(), String> {
Err(format!("Oops! An error happened in {} on line {}", file!(), line!()))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment