Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created April 23, 2018 00:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rust-play/17bac784bd4cdf0ef61eb04df6468d71 to your computer and use it in GitHub Desktop.
Save rust-play/17bac784bd4cdf0ef61eb04df6468d71 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
use std::error::Error;
fn foo() -> Result<(), Box<Error + Send + Sync>> {
unimplemented!()
}
fn bar() -> Result<(), Box<Error>> {
foo().map_err(|e| e as Box<Error>)?;
Ok(())
}
fn main() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment