summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Leckey <ryan@launchbadge.com>2017-07-28 10:19:33 -0700
committerRyan Leckey <ryan@launchbadge.com>2017-07-28 10:19:33 -0700
commit71f4b182d1e56febda64bd620ae0e0f65de333cd (patch)
tree19860ebfb7edb49d8fdd2c6a9bddde9501509210
parent40801dab0dbfa9a3e421655bc3c3b25bbf8c4c06 (diff)
Use 'yaml::Hash' instead of assuming the underlying type is BTreeMap
-rw-r--r--src/file/format/yaml.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/file/format/yaml.rs b/src/file/format/yaml.rs
index 3ed1356..9bcf9d4 100644
--- a/src/file/format/yaml.rs
+++ b/src/file/format/yaml.rs
@@ -2,7 +2,7 @@ use yaml_rust as yaml;
use source::Source;
use std::error::Error;
use std::fmt;
-use std::collections::{BTreeMap, HashMap};
+use std::collections::HashMap;
use std::mem;
use value::{Value, ValueKind};
@@ -10,7 +10,7 @@ pub fn parse(uri: Option<&String>, text: &str) -> Result<HashMap<String, Value>,
// Parse a YAML object from file
let mut docs = yaml::YamlLoader::load_from_str(text)?;
let root = match docs.len() {
- 0 => yaml::Yaml::Hash(BTreeMap::new()),
+ 0 => yaml::Yaml::Hash(yaml::yaml::Hash::new()),
1 => mem::replace(&mut docs[0], yaml::Yaml::Null),
n => {
return Err(Box::new(MultipleDocumentsError(n)));