diff options
author | David Orchard <if_coding@fastmail.com> | 2021-07-28 22:52:15 -0700 |
---|---|---|
committer | David Orchard <if_coding@fastmail.com> | 2021-08-15 10:31:18 -0700 |
commit | fc8cf0ed674cbb495df1baff34d4b832ca5fad3c (patch) | |
tree | a83c82ff11399ebd2da8d7ae58da31b7f295998c /src/path/mod.rs | |
parent | 62c84297e5340d717d89c5c0b36ed86dd5ad9d2f (diff) |
Use LinkedHashMap in place of HashMap
Diffstat (limited to 'src/path/mod.rs')
-rw-r--r-- | src/path/mod.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/path/mod.rs b/src/path/mod.rs index d58a6f2..04c424c 100644 --- a/src/path/mod.rs +++ b/src/path/mod.rs @@ -1,4 +1,4 @@ -use std::collections::HashMap; +use linked_hash_map::LinkedHashMap; use std::str::FromStr; use crate::error::*; @@ -135,7 +135,7 @@ impl Expression { ), _ => { - *value = HashMap::<String, Value>::new().into(); + *value = LinkedHashMap::<String, Value>::new().into(); if let ValueKind::Table(ref mut map) = value.kind { Some( @@ -186,7 +186,7 @@ impl Expression { ValueKind::Table(_) => {} _ => { - *root = HashMap::<String, Value>::new().into(); + *root = LinkedHashMap::<String, Value>::new().into(); } } @@ -195,7 +195,7 @@ impl Expression { // Pull out another table let mut target = if let ValueKind::Table(ref mut map) = root.kind { map.entry(id.clone()) - .or_insert_with(|| HashMap::<String, Value>::new().into()) + .or_insert_with(|| LinkedHashMap::<String, Value>::new().into()) } else { unreachable!(); }; @@ -224,7 +224,7 @@ impl Expression { _ => { // Didn't find a table. Oh well. Make a table and do this anyway - *parent = HashMap::<String, Value>::new().into(); + *parent = LinkedHashMap::<String, Value>::new().into(); Expression::Identifier(key.clone()).set(parent, value); } |