Skip to content

Instantly share code, notes, and snippets.

Created March 2, 2018 01:02
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save anonymous/995d0ffab5d6c717006c8d70eb87f041 to your computer and use it in GitHub Desktop.
Rust code shared from the playground
use std::io::{Error, ErrorKind};
fn hmm(go: bool) -> Result<String, Error> {
match go {
true => Ok(String::from("good to go")),
_ => Err(Error::new(ErrorKind::Other, "bad")),
}
}
fn gonogo(go: bool) -> Result<String, Error> {
hmm(go)
}
fn main() {
println!("{:?}", gonogo(true));
println!("{:?}", gonogo(false));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment