Use map instead of match on Option

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

View File

@ -131,10 +131,8 @@ impl Config {
pub fn update_from_env(&mut self) { pub fn update_from_env(&mut self) {
debug!("Updating the config from environment variables"); debug!("Updating the config from environment variables");
let overrides = env::vars().filter_map(|(key, value)| match parse_env(&key) { let overrides =
Some(index) => Some((index, value)), env::vars().filter_map(|(key, value)| parse_env(&key).map(|index| (index, value)));
None => None,
});
for (key, value) in overrides { for (key, value) in overrides {
trace!("{} => {}", key, value); trace!("{} => {}", key, value);