summaryrefslogtreecommitdiffstats
path: root/src/file
diff options
context:
space:
mode:
authorRyan Leckey <leckey.ryan@gmail.com>2017-02-07 17:09:41 -0800
committerRyan Leckey <leckey.ryan@gmail.com>2017-02-07 17:09:41 -0800
commit9239ee5c27eb6d87098b10cb8e1f4ea9465d1add (patch)
treef4a3fb1098a94ca1fc148360ab90434c06400b4f /src/file
parent115fe07e2c11aa72e91a5ce9b028ed1c1ff7d806 (diff)
Add path resolution using a strict subset of JSONPath
Diffstat (limited to 'src/file')
-rw-r--r--src/file/json.rs8
-rw-r--r--src/file/mod.rs4
-rw-r--r--src/file/toml.rs4
3 files changed, 9 insertions, 7 deletions
diff --git a/src/file/json.rs b/src/file/json.rs
index d193da4..86612c9 100644
--- a/src/file/json.rs
+++ b/src/file/json.rs
@@ -21,9 +21,7 @@ impl Content {
fn from_json_value(value: &serde_json::Value) -> Value {
match *value {
- serde_json::Value::String(ref value) => {
- Value::String(value.clone())
- }
+ serde_json::Value::String(ref value) => Value::String(value.clone()),
serde_json::Value::Number(ref value) => {
if let Some(value) = value.as_i64() {
@@ -58,7 +56,9 @@ fn from_json_value(value: &serde_json::Value) -> Value {
}
// TODO: What's left is JSON Null; how should we handle that?
- _ => { unimplemented!(); }
+ _ => {
+ unimplemented!();
+ }
}
}
diff --git a/src/file/mod.rs b/src/file/mod.rs
index e85d082..7e9d1a2 100644
--- a/src/file/mod.rs
+++ b/src/file/mod.rs
@@ -158,7 +158,7 @@ impl File<FileSourceFile> {
source: FileSourceFile {
name: name.into(),
path: None,
- }
+ },
}
}
}
@@ -176,7 +176,7 @@ impl<T: FileSource> File<T> {
impl File<FileSourceFile> {
pub fn path(self, path: &str) -> Self {
- File { source: FileSourceFile { path: Some(path.into()), ..self.source } , ..self }
+ File { source: FileSourceFile { path: Some(path.into()), ..self.source }, ..self }
}
pub fn namespace(self, namespace: &str) -> Self {
diff --git a/src/file/toml.rs b/src/file/toml.rs
index 4de23ef..28a1507 100644
--- a/src/file/toml.rs
+++ b/src/file/toml.rs
@@ -47,7 +47,9 @@ fn from_toml_value(value: &toml::Value) -> Value {
Value::Array(l)
}
- _ => { unimplemented!(); }
+ _ => {
+ unimplemented!();
+ }
}
}