Created
March 2, 2018 01:02
Star
You must be signed in to star a gist
Rust code shared from the playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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