diff options
author | Ryan Leckey <leckey.ryan@gmail.com> | 2017-07-30 13:46:04 -0700 |
---|---|---|
committer | Ryan Leckey <leckey.ryan@gmail.com> | 2017-07-30 13:46:04 -0700 |
commit | 011b809e104242f7fe9f6c00a54804b1cf0e125c (patch) | |
tree | 6b8753a73d950e9f517f5a20109026f66bafa849 /src | |
parent | 14224be23dc2f253a240b85214927d97e1160669 (diff) |
Impl Config for Source to allow merging whole configs; closes #28
Diffstat (limited to 'src')
-rw-r--r-- | src/config.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs index 0ff2601..f890461 100644 --- a/src/config.rs +++ b/src/config.rs @@ -190,3 +190,13 @@ impl Config { self.get(key).and_then(Value::into_array) } } + +impl Source for Config { + fn clone_into_box(&self) -> Box<Source + Send + Sync> { + Box::new((*self).clone()) + } + + fn collect(&self) -> Result<HashMap<String, Value>> { + self.cache.clone().into_table() + } +} |