diff options
author | Ryan Leckey <leckey.ryan@gmail.com> | 2017-02-07 17:17:50 -0800 |
---|---|---|
committer | Ryan Leckey <leckey.ryan@gmail.com> | 2017-02-07 17:17:50 -0800 |
commit | 010b2d6759a8d21de04a86c9babf470c8ed77a6a (patch) | |
tree | 7ac02ba80fb57a5e50ef2ebe77288ee45d6bb3ab /src/file | |
parent | 788a08756ab88b48c117257685ad7b93b8fab641 (diff) |
:shirt:
Diffstat (limited to 'src/file')
-rw-r--r-- | src/file/yaml.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/file/yaml.rs b/src/file/yaml.rs index 1c3ccbb..72a987a 100644 --- a/src/file/yaml.rs +++ b/src/file/yaml.rs @@ -7,10 +7,9 @@ use std::collections::{BTreeMap, HashMap}; use std::mem; use value::Value; - pub struct Content { // Root table of the YAML document - root: yaml::Yaml + root: yaml::Yaml, } impl Content { @@ -19,10 +18,8 @@ impl Content { match docs.len() { 0 => Ok(Box::new(Content { root: yaml::Yaml::Hash(BTreeMap::new()) })), - 1 => Ok(Box::new(Content { - root: mem::replace(&mut docs[0], yaml::Yaml::Null) - })), - n => Err(Box::new(MultipleDocumentsError(n))) + 1 => Ok(Box::new(Content { root: mem::replace(&mut docs[0], yaml::Yaml::Null) })), + n => Err(Box::new(MultipleDocumentsError(n))), } } @@ -52,7 +49,9 @@ fn from_yaml_value<'a>(value: &yaml::Yaml) -> Value { Value::Array(l) } // TODO: how should we handle Null and BadValue? - _ => { unimplemented!(); } + _ => { + unimplemented!(); + } } } |