summaryrefslogtreecommitdiffstats
path: root/src/file/format/json.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/file/format/json.rs
parent0e0ae2b359b5c943055c988c3c78f36db2503468 (diff)
Rename MapImpl to Map
Diffstat (limited to 'src/file/format/json.rs')
-rw-r--r--src/file/format/json.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/file/format/json.rs b/src/file/format/json.rs
index c4895fb..e3d8b87 100644
--- a/src/file/format/json.rs
+++ b/src/file/format/json.rs
@@ -1,19 +1,19 @@
use std::error::Error;
-use crate::map::MapImpl;
+use crate::map::Map;
use crate::value::{Value, ValueKind};
pub fn parse(
uri: Option<&String>,
text: &str,
-) -> Result<MapImpl<String, Value>, Box<dyn Error + Send + Sync>> {
+) -> Result<Map<String, Value>, Box<dyn Error + Send + Sync>> {
// Parse a JSON object value from the text
// TODO: Have a proper error fire if the root of a file is ever not a Table
let value = from_json_value(uri, &serde_json::from_str(text)?);
match value.kind {
ValueKind::Table(map) => Ok(map),
- _ => Ok(MapImpl::new()),
+ _ => Ok(Map::new()),
}
}
@@ -34,7 +34,7 @@ fn from_json_value(uri: Option<&String>, value: &serde_json::Value) -> Value {
serde_json::Value::Bool(value) => Value::new(uri, ValueKind::Boolean(value)),
serde_json::Value::Object(ref table) => {
- let mut m = MapImpl::new();
+ let mut m = Map::new();
for (key, value) in table {
m.insert(key.clone(), from_json_value(uri, value));