summaryrefslogtreecommitdiffstats
path: root/src/config.rs
diff options
context:
space:
mode:
authorDavid Orchard <if_coding@fastmail.com>2021-08-02 23:17:08 -0700
committerDavid Orchard <if_coding@fastmail.com>2021-08-15 10:34:05 -0700
commitbe82af2a474b9c6ac85ec1e001af1704521820e6 (patch)
treeb065f9a4adaddfad570b370937e8081cd6fa70ed /src/config.rs
parent0e0ae2b359b5c943055c988c3c78f36db2503468 (diff)
Rename MapImpl to Map
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/config.rs b/src/config.rs
index 8c410f0..55844ce 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -5,7 +5,7 @@ use serde::de::Deserialize;
use serde::ser::Serialize;
use crate::error::*;
-use crate::map::MapImpl;
+use crate::map::Map;
use crate::path;
use crate::ser::ConfigSerializer;
use crate::source::Source;
@@ -16,8 +16,8 @@ use crate::value::{Table, Value};
/// them according to the source's priority.
#[derive(Clone, Debug)]
pub struct Config {
- defaults: MapImpl<path::Expression, Value>,
- overrides: MapImpl<path::Expression, Value>,
+ defaults: Map<path::Expression, Value>,
+ overrides: Map<path::Expression, Value>,
sources: Vec<Box<dyn Source + Send + Sync>>,
/// Root of the cached configuration.
@@ -83,7 +83,7 @@ impl Config {
#[deprecated(since = "0.12.0", note = "please use 'ConfigBuilder' instead")]
pub fn refresh(&mut self) -> Result<&mut Config> {
self.cache = {
- let mut cache: Value = MapImpl::<String, Value>::new().into();
+ let mut cache: Value = Map::<String, Value>::new().into();
// Add defaults
for (key, val) in self.defaults.iter() {
@@ -181,7 +181,7 @@ impl Config {
self.get(key).and_then(Value::into_bool)
}
- pub fn get_table(&self, key: &str) -> Result<MapImpl<String, Value>> {
+ pub fn get_table(&self, key: &str) -> Result<Map<String, Value>> {
self.get(key).and_then(Value::into_table)
}
@@ -212,7 +212,7 @@ impl Source for Config {
Box::new((*self).clone())
}
- fn collect(&self) -> Result<MapImpl<String, Value>> {
+ fn collect(&self) -> Result<Map<String, Value>> {
self.cache.clone().into_table()
}
}