aboutsummaryrefslogtreecommitdiff
path: root/src/toml.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-07-15 17:30:00 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-07-15 17:30:00 -0700
commitb4a4ed72d7b13fb8012878a191c7ca15de995030 (patch)
treeddd7ba29b4b36927085f05b7e7804c58d28d9ab1 /src/toml.rs
parentbec6b768ec50e2f918511075bf5b167b14a7df00 (diff)
downloadmilf-rs-b4a4ed72d7b13fb8012878a191c7ca15de995030.tar.gz
milf-rs-b4a4ed72d7b13fb8012878a191c7ca15de995030.zip
Migrate to a TreeMap for determinism
Diffstat (limited to 'src/toml.rs')
-rw-r--r--src/toml.rs6
1 files changed, 3 insertions, 3 deletions
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<Value>;
-pub type Table = HashMap<String, Value>;
+pub type Table = TreeMap<String, Value>;
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
}