From a9dae326fafe44eac0a8803832f066028e65c04a Mon Sep 17 00:00:00 2001 From: Jeremy Stucki Date: Thu, 20 Jun 2019 14:27:57 +0200 Subject: [PATCH] Use unwrap_or instead of match on Result --- src/config.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/config.rs b/src/config.rs index 10b0b570..bfd00797 100644 --- a/src/config.rs +++ b/src/config.rs @@ -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.