Use unwrap_or instead of match on Result

This commit is contained in:
Jeremy Stucki 2019-06-20 14:27:57 +02:00
parent abba959add
commit a9dae326fa
No known key found for this signature in database
GPG Key ID: EEFCA93148042655
1 changed files with 1 additions and 4 deletions

View File

@ -149,10 +149,7 @@ impl Config {
/// `output.html.playpen` will fetch the "playpen" out of the html output
/// table).
pub fn get(&self, key: &str) -> Option<&Value> {
match self.rest.read(key) {
Ok(inner) => inner,
Err(_) => None,
}
self.rest.read(key).unwrap_or(None)
}
/// Fetch a value from the `Config` so you can mutate it.