From 71f4b182d1e56febda64bd620ae0e0f65de333cd Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Fri, 28 Jul 2017 10:19:33 -0700 Subject: Use 'yaml::Hash' instead of assuming the underlying type is BTreeMap --- src/file/format/yaml.rs | 4 ++-- 1 file 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, // 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))); -- cgit v1.2.3