Use map instead of match on Option
This commit is contained in:
parent
d07bd9fed4
commit
ea15e55829
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue