From be251fef2cfcf79a34f5c4e5086c715234281b5e Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Fri, 16 Jun 2017 11:45:23 -0700 Subject: Fix a couple issues, mainly with env source --- src/config.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/config.rs') 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()) + } } } -- cgit v1.2.3