Minify mapping

This commit is contained in:
Matthias Beyer 2017-06-03 14:47:29 +02:00
parent e5fa71d1e7
commit eff4f547ba
1 changed files with 14 additions and 16 deletions

View File

@ -135,23 +135,21 @@ impl Configuration {
None None
} }
}) })
.map(|(k, v)| { .map(|(k, v)| self
self.config .config
.read(&k[..]) .read(&k[..])
.map_err_into(CEK::TOMLParserError) .map_err_into(CEK::TOMLParserError)
.map(|toml| match toml { .map(|toml| match toml {
Some(value) => { Some(value) => match into_value(value, v) {
match into_value(value, v) {
Some(v) => { Some(v) => {
info!("Successfully overridden: {} = {}", k, v); info!("Successfully overridden: {} = {}", k, v);
Ok(v) Ok(v)
}, },
None => Err(CEK::ConfigOverrideTypeNotMatching.into_error()), None => Err(CEK::ConfigOverrideTypeNotMatching.into_error()),
}
}, },
None => Err(CEK::ConfigOverrideKeyNotAvailable.into_error()), None => Err(CEK::ConfigOverrideKeyNotAvailable.into_error()),
}) })
}) )
.fold_result(|i| i) .fold_result(|i| i)
.map_err(Box::new) .map_err(Box::new)
.map_err(|e| CEK::ConfigOverrideError.into_error_with_cause(e)) .map_err(|e| CEK::ConfigOverrideError.into_error_with_cause(e))