diff options
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/src/config.rs b/src/config.rs index c8fc2e4..f1d5e93 100644 --- a/src/config.rs +++ b/src/config.rs @@ -89,26 +89,8 @@ impl Config { } // Add sources - for source in sources { - let props = match source.collect() { - Ok(props) => props, - Err(error) => { - return ConfigResult(Err(error)); - } - }; - - for (key, val) in &props { - match path::Expression::from_str(key) { - // Set using the path - Ok(expr) => expr.set(&mut cache, val.clone()), - - // Set diretly anyway - _ => { - path::Expression::Identifier(key.clone()) - .set(&mut cache, val.clone()) - } - } - } + if let Err(error) = sources.collect_to(&mut cache) { + return ConfigResult(Err(error)); } // Add overrides |