Created
June 17, 2017 07:57
-
-
Save andete/ee8e5c6e3e3f01ad63a41464b309dcdd to your computer and use it in GitHub Desktop.
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
impl FromStr for Lang { | |
type Err = Error; | |
fn from_str(s:&str) -> Result<Self> { | |
match s { | |
"nl" => Ok(Lang::Nl), | |
"en" => Ok(Lang::En), | |
o => Err(format!("Unsupported language: {}", o).into()), | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment