diff options
author | Canop <cano.petrole@gmail.com> | 2024-05-31 17:11:15 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2024-05-31 17:11:15 +0200 |
commit | 205015c2f3632466f137ec5fa17cc78dd6495423 (patch) | |
tree | b7ccdcc034abed635ff5bbe32d01c1d4de7a04e2 | |
parent | ae9991f1e7a17f98ac7ed2a2202180aec77b5048 (diff) |
replace ahash with rustc-hash
-rw-r--r-- | Cargo.lock | 46 | ||||
-rw-r--r-- | Cargo.toml | 6 | ||||
-rw-r--r-- | src/conf/conf.rs | 6 | ||||
-rw-r--r-- | src/file_sum/mod.rs | 37 | ||||
-rw-r--r-- | src/file_sum/sum_computation.rs | 41 | ||||
-rw-r--r-- | src/git/status.rs | 50 | ||||
-rw-r--r-- | src/git/status_computer.rs | 25 | ||||
-rw-r--r-- | src/icon/font.rs | 26 | ||||
-rw-r--r-- | src/path/from.rs | 4 | ||||
-rw-r--r-- | src/skin/app_skin.rs | 4 | ||||
-rw-r--r-- | src/skin/ext_colors.rs | 8 | ||||
-rw-r--r-- | src/skin/style_map.rs | 4 | ||||
-rw-r--r-- | src/tree/tree_line_type.rs | 4 | ||||
-rw-r--r-- | src/verb/execution_builder.rs | 6 | ||||
-rw-r--r-- | src/verb/invocation_parser.rs | 6 | ||||
-rw-r--r-- | src/verb/verb_store.rs | 2 |
16 files changed, 144 insertions, 131 deletions
@@ -15,20 +15,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0453232ace82dee0dd0b4c87a59bd90f7b53b314f3e0f61fe2ee7c8a16482289" [[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "getrandom", - "once_cell", - "serde", - "version_check", - "zerocopy", -] - -[[package]] name = "aho-corasick" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -217,9 +203,8 @@ checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] name = "broot" -version = "1.38.0" +version = "1.39.0-dev" dependencies = [ - "ahash 0.8.11", "ansi_colours", "base64 0.21.7", "bet", @@ -254,6 +239,7 @@ dependencies = [ "phf", "rayon", "resvg", + "rustc-hash", "secular", "serde", "smallvec", @@ -958,7 +944,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" dependencies = [ - "ahash 0.4.8", + "ahash", ] [[package]] @@ -1824,6 +1810,12 @@ dependencies = [ ] [[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] name = "rustix" version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2927,26 +2919,6 @@ dependencies = [ ] [[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.60", -] - -[[package]] name = "zune-inflate" version = "0.2.54" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1,6 +1,6 @@ [package] name = "broot" -version = "1.38.0" +version = "1.39.0-dev" authors = ["dystroy <denys.seguret@gmail.com>"] repository = "https://github.com/Canop/broot" homepage = "https://dystroy.org/broot" @@ -23,7 +23,6 @@ kitty-csi-check = ["xterm-query"] trash = ["dep:trash"] [dependencies] -ahash = { version = "0.8.3", features = ["serde"] } ansi_colours = "1.2" base64 = "0.21" bet = "1.0.3" @@ -53,6 +52,7 @@ pathdiff = "0.2" phf = { version = "0.11", features = ["macros"] } rayon = "1.9" resvg = "0.36" # several options behind, as it's always a PITA to upgrade +rustc-hash = "1" secular = { version = "1.0", features = ["normalization", "bmp"] } serde = { version = "1.0", features = ["derive"] } smallvec = "1.11" # version 2 is still alpha @@ -90,7 +90,7 @@ debug = false [profile.release] debug = false -lto = true +lto = "fat" codegen-units = 1 # this removes a few hundred bytes from the final exec size strip = true diff --git a/src/conf/conf.rs b/src/conf/conf.rs index 42dd56e..98df97e 100644 --- a/src/conf/conf.rs +++ b/src/conf/conf.rs @@ -16,7 +16,7 @@ use { syntactic::SyntaxTheme, verb::ExecPattern, }, - ahash::AHashMap, + rustc_hash::FxHashMap, crokey::crossterm::style::Attribute, fnv::FnvHashMap, serde::Deserialize, @@ -66,7 +66,7 @@ pub struct Conf { pub enable_kitty_keyboard: Option<bool>, #[serde(default, alias="ext-colors")] - pub ext_colors: AHashMap<String, String>, + pub ext_colors: FxHashMap<String, String>, pub file_sum_threads_count: Option<usize>, @@ -112,7 +112,7 @@ pub struct Conf { #[serde(alias="show-selection-mark")] pub show_selection_mark: Option<bool>, - pub skin: Option<AHashMap<String, SkinEntry>>, + pub skin: Option<FxHashMap<String, SkinEntry>>, #[serde(default, alias="special-paths")] pub special_paths: HashMap<GlobConf, SpecialHandlingConf>, diff --git a/src/file_sum/mod.rs b/src/file_sum/mod.rs index 9aac2fc..5662582 100644 --- a/src/file_sum/mod.rs +++ b/src/file_sum/mod.rs @@ -1,7 +1,6 @@ /// compute consolidated data for directories: modified date, size, and count. /// A cache is used to avoid recomputing the same directories again and again. /// On unix, hard links are checked to avoid counting twice an inode. - mod sum_computation; use { @@ -9,20 +8,22 @@ use { app::*, task_sync::Dam, }, - ahash::AHashMap, once_cell::sync::Lazy, + rustc_hash::FxHashMap, std::{ ops::AddAssign, - path::{Path, PathBuf}, + path::{ + Path, + PathBuf, + }, sync::Mutex, }, }; pub const DEFAULT_THREAD_COUNT: usize = 5; -static SUM_CACHE: Lazy<Mutex<AHashMap<PathBuf, FileSum>>> = Lazy::new(|| { - Mutex::new(AHashMap::default()) -}); +static SUM_CACHE: Lazy<Mutex<FxHashMap<PathBuf, FileSum>>> = + Lazy::new(|| Mutex::new(FxHashMap::default())); pub fn clear_cache() { SUM_CACHE.lock().unwrap().clear(); @@ -44,7 +45,12 @@ impl FileSum { count: usize, modified: u32, ) -> Self { - Self { real_size, count, modified, sparse } + Self { + real_size, + count, + modified, + sparse, + } } pub fn zero() -> Self { @@ -64,7 +70,11 @@ impl FileSum { /// Return the sum of the directory, either by computing it of by /// fetching it from cache. /// If the lifetime expires before complete computation, None is returned. - pub fn from_dir(path: &Path, dam: &Dam, con: &AppContext) -> Option<Self> { + pub fn from_dir( + path: &Path, + dam: &Dam, + con: &AppContext, + ) -> Option<Self> { let mut sum_cache = SUM_CACHE.lock().unwrap(); match sum_cache.get(path) { Some(sum) => Some(*sum), @@ -82,7 +92,10 @@ impl FileSum { } } - pub fn part_of_size(self, total: Self) -> f32 { + pub fn part_of_size( + self, + total: Self, + ) -> f32 { if total.real_size == 0 { 0.0 } else { @@ -119,7 +132,10 @@ impl FileSum { impl AddAssign for FileSum { #[allow(clippy::suspicious_op_assign_impl)] - fn add_assign(&mut self, other: Self) { + fn add_assign( + &mut self, + other: Self, + ) { *self = Self::new( self.real_size + other.real_size, self.sparse | other.sparse, @@ -128,4 +144,3 @@ impl AddAssign for FileSum { ); } } - diff --git a/src/file_sum/sum_computation.rs b/src/file_sum/sum_computation.rs index 4146574..7f35ade 100644 --- a/src/file_sum/sum_computation.rs +++ b/src/file_sum/sum_computation.rs @@ -5,15 +5,24 @@ use { path::*, task_sync::Dam, }, - ahash::AHashMap, crossbeam::channel, - rayon::{ThreadPool, ThreadPoolBuilder}, + rayon::{ + ThreadPool, + ThreadPoolBuilder, + }, + rustc_hash::FxHashMap, std::{ convert::TryInto, fs, - path::{Path, PathBuf}, + path::{ + Path, + PathBuf, + }, sync::{ - atomic::{AtomicIsize, Ordering}, + atomic::{ + AtomicIsize, + Ordering, + }, Arc, Mutex, }, @@ -23,9 +32,7 @@ use { #[cfg(unix)] use { fnv::FnvHashSet, - std::{ - os::unix::fs::MetadataExt, - }, + std::os::unix::fs::MetadataExt, }; struct DirSummer { @@ -62,7 +69,7 @@ impl DirSummer { pub fn compute_dir_sum( &mut self, path: &Path, - cache: &mut AHashMap<PathBuf, FileSum>, + cache: &mut FxHashMap<PathBuf, FileSum>, dam: &Dam, con: &AppContext, ) -> Option<FileSum> { @@ -77,7 +84,7 @@ impl DirSummer { debug!("not summing in /proc"); return Some(FileSum::zero()); } - if path.starts_with("/run") && ! path.starts_with("/run/media") { + if path.starts_with("/run") && !path.starts_with("/run/media") { debug!("not summing in /run"); return Some(FileSum::zero()); } @@ -123,7 +130,6 @@ impl DirSummer { busy += 1; dirs_sender.send(Some(entry_path)).unwrap(); } else { - #[cfg(unix)] if md.nlink() > 1 { let mut nodes = nodes.lock().unwrap(); @@ -136,7 +142,6 @@ impl DirSummer { continue; } } - } sum += md_sum(&md); } @@ -175,7 +180,6 @@ impl DirSummer { for e in entries.flatten() { if let Ok(md) = e.metadata() { if md.is_dir() { - let path = e.path(); if special_paths.sum(&path) == Directive::Never { @@ -188,7 +192,6 @@ impl DirSummer { busy.fetch_add(1, Ordering::Relaxed); dirs_sender.send(Some(path)).unwrap(); } else { - #[cfg(unix)] if md.nlink() > 1 { let mut nodes = nodes.lock().unwrap(); @@ -201,7 +204,6 @@ impl DirSummer { continue; } } - } thread_sum += md_sum(&md); } else { @@ -242,24 +244,22 @@ impl DirSummer { } } - /// compute the consolidated numbers for a directory, with implementation /// varying depending on the OS: /// On unix, the computation is done on blocks of 512 bytes /// see https://doc.rust-lang.org/std/os/unix/fs/trait.MetadataExt.html#tymethod.blocks pub fn compute_dir_sum( path: &Path, - cache: &mut AHashMap<PathBuf, FileSum>, + cache: &mut FxHashMap<PathBuf, FileSum>, dam: &Dam, con: &AppContext, ) -> Option<FileSum> { use once_cell::sync::OnceCell; static DIR_SUMMER: OnceCell<Mutex<DirSummer>> = OnceCell::new(); DIR_SUMMER - .get_or_init(|| { - Mutex::new(DirSummer::new(con.file_sum_threads_count)) - }) - .lock().unwrap() + .get_or_init(|| Mutex::new(DirSummer::new(con.file_sum_threads_count))) + .lock() + .unwrap() .compute_dir_sum(path, cache, dam, con) } @@ -307,7 +307,6 @@ fn extract_seconds(md: &fs::Metadata) -> u32 { 0 } - #[inline(always)] fn md_sum(md: &fs::Metadata) -> FileSum { #[cfg(unix)] diff --git a/src/git/status.rs b/src/git/status.rs index 04bc415..df10a2d 100644 --- a/src/git/status.rs +++ b/src/git/status.rs @@ -1,8 +1,13 @@ use { - git2::{self, Repository, Status}, - ahash::AHashMap, - std::{ - path::{Path, PathBuf}, + git2::{ + self, + Repository, + Status, + }, + rustc_hash::FxHashMap, + std::path::{ + Path, + PathBuf, }, }; @@ -17,7 +22,10 @@ pub struct LineGitStatus { } impl LineGitStatus { - pub fn from(repo: &Repository, relative_path: &Path) -> Option<LineGitStatus> { + pub fn from( + repo: &Repository, + relative_path: &Path, + ) -> Option<LineGitStatus> { repo.status_file(relative_path) .ok() .map(|status| LineGitStatus { status }) @@ -31,12 +39,12 @@ impl LineGitStatus { /// looks at all the statuses of the repo and build a map path->status /// which can then be efficiently queried pub struct LineStatusComputer { - interesting_statuses: AHashMap<PathBuf, Status>, + interesting_statuses: FxHashMap<PathBuf, Status>, } impl LineStatusComputer { pub fn from(repo: Repository) -> Option<Self> { let workdir = repo.workdir()?; - let mut interesting_statuses = AHashMap::default(); + let mut interesting_statuses = FxHashMap::default(); let statuses = repo.statuses(None).ok()?; for entry in statuses.iter() { let status = entry.status(); @@ -47,14 +55,22 @@ impl LineStatusComputer { } } } - Some(Self { interesting_statuses }) + Some(Self { + interesting_statuses, + }) } - pub fn line_status(&self, path: &Path) -> Option<LineGitStatus> { + pub fn line_status( + &self, + path: &Path, + ) -> Option<LineGitStatus> { self.interesting_statuses .get(path) .map(|&status| LineGitStatus { status }) } - pub fn is_interesting(&self, path: &Path) -> bool { + pub fn is_interesting( + &self, + path: &Path, + ) -> bool { self.interesting_statuses.contains_key(path) } } @@ -73,15 +89,13 @@ impl TreeGitStatus { .ok() .and_then(|head| head.shorthand().map(String::from)); let stats = match repo.diff_index_to_workdir(None, None) { - Ok(diff) => { - match diff.stats() { - Ok(stats) => stats, - Err(e) => { - debug!("get stats failed : {:?}", e); - return None; - } + Ok(diff) => match diff.stats() { + Ok(stats) => stats, + Err(e) => { + debug!("get stats failed : {:?}", e); + return None; } - } + }, Err(e) => { debug!("get diff failed : {:?}", e); return None; diff --git a/src/git/status_computer.rs b/src/git/status_computer.rs index bb6bdc7..bd8bc78 100644 --- a/src/git/status_computer.rs +++ b/src/git/status_computer.rs @@ -2,14 +2,21 @@ use { super::TreeGitStatus, crate::{ git, - task_sync::{Computation, ComputationResult, Dam}, + task_sync::{ + Computation, + ComputationResult, + Dam, + }, }, crossbeam::channel::bounded, - ahash::AHashMap, git2::Repository, once_cell::sync::Lazy, + rustc_hash::FxHashMap, std::{ - path::{Path, PathBuf}, + path::{ + Path, + PathBuf, + }, sync::Mutex, }, }; @@ -30,10 +37,9 @@ fn compute_tree_status(root_path: &Path) -> ComputationResult<TreeGitStatus> { } } - // the key is the path of the repository -static TS_CACHE_MX: Lazy<Mutex<AHashMap<PathBuf, Computation<TreeGitStatus>>>> = Lazy::new(|| { - Mutex::new(AHashMap::default()) -}); +// the key is the path of the repository +static TS_CACHE_MX: Lazy<Mutex<FxHashMap<PathBuf, Computation<TreeGitStatus>>>> = + Lazy::new(|| Mutex::new(FxHashMap::default())); /// try to get the result of the computation of the tree git status. /// This may be immediate if a previous computation was finished. @@ -43,7 +49,10 @@ static TS_CACHE_MX: Lazy<Mutex<AHashMap<PathBuf, Computation<TreeGitStatus>>>> = /// - this function returns as soon as the dam asks for it (ie when there's an event) /// - computations are never dropped unless the program ends: they continue in background /// and the result may be available for following queries -pub fn get_tree_status(root_path: &Path, dam: &mut Dam) -> ComputationResult<TreeGitStatus> { +pub fn get_tree_status( + root_path: &Path, + dam: &mut Dam, +) -> ComputationResult<TreeGitStatus> { match git::closest_repo_dir(root_path) { None => ComputationResult::None, Some(repo_path) => { diff --git a/src/icon/font.rs b/src/icon/font.rs index 971d77d..c0dc24e 100644 --- a/src/icon/font.rs +++ b/src/icon/font.rs @@ -1,18 +1,22 @@ -use {super::*, crate::tree::TreeLineType, ahash::AHashMap}; +use { + super::*, + crate::tree::TreeLineType, + rustc_hash::FxHashMap, +}; pub struct FontPlugin { - icon_name_to_icon_codepoint_map: AHashMap<&'static str, u32>, - file_name_to_icon_name_map: AHashMap<&'static str, &'static str>, - double_extension_to_icon_name_map: AHashMap<&'static str, &'static str>, - extension_to_icon_name_map: AHashMap<&'static str, &'static str>, + icon_name_to_icon_codepoint_map: FxHashMap<&'static str, u32>, + file_name_to_icon_name_map: FxHashMap<&'static str, &'static str>, + double_extension_to_icon_name_map: FxHashMap<&'static str, &'static str>, + extension_to_icon_name_map: FxHashMap<&'static str, &'static str>, default_icon_point: u32, } impl FontPlugin { #[cfg(debug_assertions)] fn sanity_check( - part_to_icon_name_map: &AHashMap<&str, &str>, - icon_name_to_icon_codepoint_map: &AHashMap<&str, u32>, + part_to_icon_name_map: &FxHashMap<&str, &str>, + icon_name_to_icon_codepoint_map: &FxHashMap<&str, u32>, ) { let offending_entries = part_to_icon_name_map .iter() @@ -40,13 +44,13 @@ impl FontPlugin { extension_to_icon_name_map: &'static [(&'static str, &'static str)], file_name_to_icon_name_map: &'static [(&'static str, &'static str)], ) -> Self { - let icon_name_to_icon_codepoint_map: AHashMap<_, _> = + let icon_name_to_icon_codepoint_map: FxHashMap<_, _> = icon_name_to_icon_codepoint_map.iter().cloned().collect(); - let double_extension_to_icon_name_map: AHashMap<_, _> = + let double_extension_to_icon_name_map: FxHashMap<_, _> = double_extension_to_icon_name_map.iter().cloned().collect(); - let extension_to_icon_name_map: AHashMap<_, _> = + let extension_to_icon_name_map: FxHashMap<_, _> = extension_to_icon_name_map.iter().cloned().collect(); - let file_name_to_icon_name_map: AHashMap<_, _> = + let file_name_to_icon_name_map: FxHashMap<_, _> = file_name_to_icon_name_map.iter().cloned().collect(); #[cfg(debug_assertions)] diff --git a/src/path/from.rs b/src/path/from.rs index 702e615..df6d1fa 100644 --- a/src/path/from.rs +++ b/src/path/from.rs @@ -1,7 +1,7 @@ use { super::*, directories::UserDirs, - ahash::AHashMap, + rustc_hash::FxHashMap, lazy_regex::*, std::path::{Path, PathBuf}, }; @@ -73,7 +73,7 @@ pub fn path_str_from<P: AsRef<Path> + std::fmt::Debug>( /// data from the user input and from the selected line pub fn do_exec_replacement( ec: &Captures<'_>, - replacement_map: &AHashMap<String, String>, + replacement_map: &FxHashMap<String, String>, ) -> String { let name = ec.get(1).unwrap().as_str(); if let Some(repl) = replacement_map.get(name) { diff --git a/src/skin/app_skin.rs b/src/skin/app_skin.rs index 7c3e95b..9f11049 100644 --- a/src/skin/app_skin.rs +++ b/src/skin/app_skin.rs @@ -3,7 +3,7 @@ use { crate::{ conf::Conf, }, - ahash::AHashMap, + rustc_hash::FxHashMap, }; @@ -30,7 +30,7 @@ impl AppSkin { let skin = if let Some(skin) = &conf.skin { skin } else { - def_skin = AHashMap::default(); + def_skin = FxHashMap::default(); &def_skin }; let StyleMaps { focused, unfocused } = StyleMaps::create(skin); diff --git a/src/skin/ext_colors.rs b/src/skin/ext_colors.rs index beca315..7ab8b33 100644 --- a/src/skin/ext_colors.rs +++ b/src/skin/ext_colors.rs @@ -2,7 +2,7 @@ use { crate::{ errors::InvalidSkinError, }, - ahash::AHashMap, + rustc_hash::FxHashMap, crokey::crossterm::style::Color, lazy_regex::*, std::convert::TryFrom, @@ -14,7 +14,7 @@ use { /// color to use when drawing the tree #[derive(Debug, Clone, Default)] pub struct ExtColorMap { - map: AHashMap<String, Color>, + map: FxHashMap<String, Color>, } impl ExtColorMap { @@ -32,9 +32,9 @@ impl ExtColorMap { } } -impl TryFrom<&AHashMap<String, String>> for ExtColorMap { +impl TryFrom<&FxHashMap<String, String>> for ExtColorMap { type Error = InvalidSkinError; - fn try_from(raw_map: &AHashMap<String, String>) -> Result<Self, Self::Error> { + fn try_from(raw_map: &FxHashMap<String, String>) -> Result<Self, Self::Error> { let mut map = ExtColorMap::default(); for (k, v) in raw_map { map.set(k.to_string(), v)?; diff --git a/src/skin/style_map.rs b/src/skin/style_map.rs index 91d14f9..3be8f9b 100644 --- a/src/skin/style_map.rs +++ b/src/skin/style_map.rs @@ -17,7 +17,7 @@ use { }, QueueableCommand, }, - ahash::AHashMap, + rustc_hash::FxHashMap, std::{ fmt, io::Write, @@ -68,7 +68,7 @@ macro_rules! StyleMap { } } impl StyleMaps { - pub fn create(skin_conf: &AHashMap<String, SkinEntry>) -> Self { + pub fn create(skin_conf: &FxHashMap<String, SkinEntry>) -> Self { let mut focused = StyleMap { styled: true, $($name: skin_conf diff --git a/src/tree/tree_line_type.rs b/src/tree/tree_line_type.rs index 6bc44a5..6b7e896 100644 --- a/src/tree/tree_line_type.rs +++ b/src/tree/tree_line_type.rs @@ -1,5 +1,5 @@ use { - ahash::AHashSet, + rustc_hash::FxHashSet, std::{ fs, io, @@ -41,7 +41,7 @@ impl TreeLineType { let mut final_ft = final_metadata.file_type(); let mut final_is_dir = final_ft.is_dir(); let mut link_chain_length = 0; - let mut visited = AHashSet::default(); + let mut visited = FxHashSet::default(); while final_ft.is_symlink() { final_target = read_link(&final_target)?; if visited.contains(&final_target) { diff --git a/src/verb/execution_builder.rs b/src/verb/execution_builder.rs index 54e33ce..26da9cf 100644 --- a/src/verb/execution_builder.rs +++ b/src/verb/execution_builder.rs @@ -5,7 +5,7 @@ use { command::*, path, }, - ahash::AHashMap, + rustc_hash::FxHashMap, regex::Captures, std::path::{Path, PathBuf}, }; @@ -24,7 +24,7 @@ pub struct ExecutionStringBuilder<'b> { other_file: Option<&'b PathBuf>, /// parsed arguments - invocation_values: Option<AHashMap<String, String>>, + invocation_values: Option<FxHashMap<String, String>>, /// whether to keep groups which can't be solved or remove them keep_groups: bool, @@ -446,7 +446,7 @@ mod execution_builder_test { SelInfo::One(sel), &app_state, ); - let mut map = AHashMap::default(); + let mut map = FxHashMap::default(); for (k, v) in replacements { map.insert(k.to_owned(), v.to_owned()); } diff --git a/src/verb/invocation_parser.rs b/src/verb/invocation_parser.rs index 02db2c2..6f4c533 100644 --- a/src/verb/invocation_parser.rs +++ b/src/verb/invocation_parser.rs @@ -6,7 +6,7 @@ use { path::PathAnchor, }, regex::Regex, - ahash::AHashMap, + rustc_hash::FxHashMap, std::{ path::PathBuf, }, @@ -129,10 +129,10 @@ impl InvocationParser { } } - pub fn parse(&self, args: &str) -> Option<AHashMap<String, String>> { + pub fn parse(&self, args: &str) -> Option<FxHashMap<String, String>> { self.args_parser.as_ref() .map(|r| { - let mut map = AHashMap::default(); + let mut map = FxHashMap::default(); if let Some(input_cap) = r.captures(args) { for name in r.capture_names().flatten() { if let Some(c) = input_cap.name(name) { diff --git a/src/verb/verb_store.rs b/src/verb/verb_store.rs index 10a6579..4908b21 100644 --- a/src/verb/verb_store.rs +++ b/src/verb/verb_store.rs @@ -160,7 +160,7 @@ impl VerbStore { .with_shortcut("dt"); #[cfg(feature = "trash")] self.add_internal(purge_trash) - .with_shortcut("pt"); + .with_shortcut("et"); #[cfg(unix)] self.add_internal(filesystems) .with_shortcut("fs"); |