From ea15e5582990a1fda1e73dc07c303c6a8f4a9dd2 Mon Sep 17 00:00:00 2001 From: Jeremy Stucki Date: Thu, 20 Jun 2019 14:18:17 +0200 Subject: [PATCH] Use map instead of match on Option --- src/config.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/config.rs b/src/config.rs index 59ae8ad0..0984c732 100644 --- a/src/config.rs +++ b/src/config.rs @@ -131,10 +131,8 @@ impl Config { pub fn update_from_env(&mut self) { debug!("Updating the config from environment variables"); - let overrides = env::vars().filter_map(|(key, value)| match parse_env(&key) { - Some(index) => Some((index, value)), - None => None, - }); + let overrides = + env::vars().filter_map(|(key, value)| parse_env(&key).map(|index| (index, value))); for (key, value) in overrides { trace!("{} => {}", key, value);