Minify mapping
This commit is contained in:
parent
e5fa71d1e7
commit
eff4f547ba
1 changed files with 14 additions and 16 deletions
|
@ -135,23 +135,21 @@ impl Configuration {
|
|||
None
|
||||
}
|
||||
})
|
||||
.map(|(k, v)| {
|
||||
self.config
|
||||
.read(&k[..])
|
||||
.map_err_into(CEK::TOMLParserError)
|
||||
.map(|toml| match toml {
|
||||
Some(value) => {
|
||||
match into_value(value, v) {
|
||||
Some(v) => {
|
||||
info!("Successfully overridden: {} = {}", k, v);
|
||||
Ok(v)
|
||||
},
|
||||
None => Err(CEK::ConfigOverrideTypeNotMatching.into_error()),
|
||||
}
|
||||
.map(|(k, v)| self
|
||||
.config
|
||||
.read(&k[..])
|
||||
.map_err_into(CEK::TOMLParserError)
|
||||
.map(|toml| match toml {
|
||||
Some(value) => match into_value(value, v) {
|
||||
Some(v) => {
|
||||
info!("Successfully overridden: {} = {}", k, v);
|
||||
Ok(v)
|
||||
},
|
||||
None => Err(CEK::ConfigOverrideKeyNotAvailable.into_error()),
|
||||
})
|
||||
})
|
||||
None => Err(CEK::ConfigOverrideTypeNotMatching.into_error()),
|
||||
},
|
||||
None => Err(CEK::ConfigOverrideKeyNotAvailable.into_error()),
|
||||
})
|
||||
)
|
||||
.fold_result(|i| i)
|
||||
.map_err(Box::new)
|
||||
.map_err(|e| CEK::ConfigOverrideError.into_error_with_cause(e))
|
||||
|
|
Loading…
Reference in a new issue