Use unwrap_or instead of match on Result
This commit is contained in:
parent
abba959add
commit
a9dae326fa
|
@ -149,10 +149,7 @@ impl Config {
|
||||||
/// `output.html.playpen` will fetch the "playpen" out of the html output
|
/// `output.html.playpen` will fetch the "playpen" out of the html output
|
||||||
/// table).
|
/// table).
|
||||||
pub fn get(&self, key: &str) -> Option<&Value> {
|
pub fn get(&self, key: &str) -> Option<&Value> {
|
||||||
match self.rest.read(key) {
|
self.rest.read(key).unwrap_or(None)
|
||||||
Ok(inner) => inner,
|
|
||||||
Err(_) => None,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Fetch a value from the `Config` so you can mutate it.
|
/// Fetch a value from the `Config` so you can mutate it.
|
||||||
|
|
Loading…
Reference in New Issue