summaryrefslogtreecommitdiffstats
path: root/src/config.rs
diff options
context:
space:
mode:
authorRyan Leckey <ryan@launchbadge.com>2017-06-16 11:45:23 -0700
committerRyan Leckey <ryan@launchbadge.com>2017-06-16 11:45:23 -0700
commitbe251fef2cfcf79a34f5c4e5086c715234281b5e (patch)
treee60fcfd50c24b047d9b1d28c4a5ac08363db7bf2 /src/config.rs
parent05e9cd421e75173462072e57ab7e27881730d250 (diff)
Fix a couple issues, mainly with env source
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/config.rs b/src/config.rs
index c355f2d..44c51d1 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -1,4 +1,5 @@
use std::collections::HashMap;
+use std::str::FromStr;
use serde::de::Deserialize;
use error::*;
@@ -88,7 +89,13 @@ impl Config {
for source in sources {
let props = source.collect()?;
for (key, val) in &props {
- path::Expression::Identifier(key.clone()).set(&mut cache, val.clone());
+ 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())
+ }
}
}