summaryrefslogtreecommitdiffstats
path: root/src/config.rs
diff options
context:
space:
mode:
authortyranron <tyranron@gmail.com>2019-04-08 15:33:14 +0300
committertyranron <tyranron@gmail.com>2019-04-08 15:33:14 +0300
commit37403d00d2dcd8c5ceca4ab7f40ef704c6df32d8 (patch)
treeca15283bab01cf4f0ea6113b38f4585b69ee6a32 /src/config.rs
parent9b0aa7362c21b01376739a013126a9db3ce355bc (diff)
Fix annoying 'invalid type: unit value, expected struct Settings' error
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/config.rs b/src/config.rs
index 893baea..03d2453 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -10,7 +10,7 @@ use ser::ConfigSerializer;
use source::Source;
use path;
-use value::{Value, ValueKind, ValueWithKey};
+use value::{Table, Value, ValueKind, ValueWithKey};
#[derive(Clone, Debug)]
enum ConfigKind {
@@ -49,7 +49,12 @@ pub struct Config {
impl Config {
pub fn new() -> Self {
- Config::default()
+ Self {
+ kind: ConfigKind::default(),
+ // Config root should be instantiated as an empty table
+ // to avoid deserialization errors.
+ cache: Value::new(None, Table::new()),
+ }
}
/// Merge in a configuration property source.