From b4a4ed72d7b13fb8012878a191c7ca15de995030 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 15 Jul 2014 17:30:00 -0700 Subject: Migrate to a TreeMap for determinism --- src/toml.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/toml.rs') diff --git a/src/toml.rs b/src/toml.rs index 440da6a..7e5908d 100644 --- a/src/toml.rs +++ b/src/toml.rs @@ -43,7 +43,7 @@ extern crate serialize; -use std::collections::HashMap; +use std::collections::TreeMap; use std::from_str::FromStr; pub use parser::{Parser, Error}; @@ -70,7 +70,7 @@ pub enum Value { } pub type Array = Vec; -pub type Table = HashMap; +pub type Table = TreeMap; impl Value { /// Tests whether this and another value have the same type. @@ -176,7 +176,7 @@ impl Value { for key in path.split('.') { match cur_value { &Table(ref hm) => { - match hm.find_equiv(&key) { + match hm.find_with(|k| key.cmp(&k.as_slice())) { Some(v) => cur_value = v, _ => return None } -- cgit v1.2.3