summaryrefslogtreecommitdiffstats
path: root/src/config.rs
diff options
context:
space:
mode:
authorRyan Leckey <ryan@launchbadge.com>2017-06-22 17:10:47 -0700
committerRyan Leckey <ryan@launchbadge.com>2017-06-22 17:10:47 -0700
commit6bfaf90fdf67197c511a7594b37d835e964edccd (patch)
treeaedca78e59887c30bd2e34626b06f24f29de0d81 /src/config.rs
parent159bb52c595384fed44a2c669198d50f2a758a9a (diff)
Implement Source for Vec<T: Source> and From<Path> for File
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs22
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