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/file/format/ini.rs | |
parent | 62c84297e5340d717d89c5c0b36ed86dd5ad9d2f (diff) |
Use LinkedHashMap in place of HashMap
Diffstat (limited to 'src/file/format/ini.rs')
-rw-r--r-- | src/file/format/ini.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/file/format/ini.rs b/src/file/format/ini.rs index b45695a..47f3499 100644 --- a/src/file/format/ini.rs +++ b/src/file/format/ini.rs @@ -1,4 +1,4 @@ -use std::collections::HashMap; +use linked_hash_map::LinkedHashMap; use std::error::Error; use ini::Ini; @@ -8,13 +8,13 @@ use crate::value::{Value, ValueKind}; pub fn parse( uri: Option<&String>, text: &str, -) -> Result<HashMap<String, Value>, Box<dyn Error + Send + Sync>> { - let mut map: HashMap<String, Value> = HashMap::new(); +) -> Result<LinkedHashMap<String, Value>, Box<dyn Error + Send + Sync>> { + let mut map: LinkedHashMap<String, Value> = LinkedHashMap::new(); let i = Ini::load_from_str(text)?; for (sec, prop) in i.iter() { match sec { Some(sec) => { - let mut sec_map: HashMap<String, Value> = HashMap::new(); + let mut sec_map: LinkedHashMap<String, Value> = LinkedHashMap::new(); for (k, v) in prop.iter() { sec_map.insert( k.to_owned(), |