Switch to LinkedHashMap

This commit is contained in:
pjht 2022-10-18 15:31:47 -05:00
parent e932bf3de5
commit 9efa91cf8f
3 changed files with 11 additions and 2 deletions

7
Cargo.lock generated
View File

@ -402,6 +402,12 @@ dependencies = [
"cc",
]
[[package]]
name = "linked-hash-map"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
[[package]]
name = "linux-raw-sys"
version = "0.0.46"
@ -437,6 +443,7 @@ dependencies = [
"human-repr",
"inventory",
"itertools",
"linked-hash-map",
"nullable-result",
"parse_int",
"paste",

View File

@ -12,6 +12,7 @@ elf = "0.1.0"
human-repr = { version = "1.0.1", features = ["iec", "space"] }
inventory = "0.3.1"
itertools = "0.10.5"
linked-hash-map = "0.5.6"
nullable-result = { version = "0.7.0", features=["try_trait"] }
parse_int = "0.6.0"
paste = "1.0.9"

View File

@ -22,6 +22,7 @@ use crate::{
use disas::DisassemblyError;
use elf::gabi::{STT_FILE, STT_SECTION};
use itertools::Itertools;
use linked_hash_map::LinkedHashMap;
use parse_int::parse;
use reedline_repl_rs::{
clap::{Arg, ArgAction, Command},
@ -38,7 +39,7 @@ use std::{
process,
};
pub type SymbolTables = HashMap<String, HashMap<String, Symbol>>;
pub type SymbolTables = LinkedHashMap<String, HashMap<String, Symbol>>;
#[derive(Copy, Clone, Debug)]
enum PeekFormat {
@ -153,7 +154,7 @@ fn main() -> Result<(), ReplError> {
Err(e) => panic!("{}", e),
};
}
let mut symbol_tables = HashMap::new();
let mut symbol_tables = LinkedHashMap::new();
if let Some(initial_tables) = config.symbol_tables {
for path in initial_tables {
let table_name = Path::new(&path).file_name().unwrap().to_str().unwrap();