|
7 | 7 |
|
8 | 8 | use clap::{Arg, ArgAction, ArgMatches, Command, builder::PossibleValue}; |
9 | 9 | use glob::Pattern; |
10 | | -use std::collections::HashSet; |
| 10 | +use rustc_hash::FxHashSet as HashSet; |
11 | 11 | use std::env; |
12 | 12 | use std::ffi::{OsStr, OsString}; |
13 | 13 | use std::fs::{self, DirEntry, File, Metadata}; |
@@ -578,7 +578,7 @@ fn du_regular( |
578 | 578 | ancestors: Option<&mut HashSet<FileInfo>>, |
579 | 579 | symlink_depth: Option<usize>, |
580 | 580 | ) -> Result<Stat, Box<mpsc::SendError<UResult<StatPrintInfo>>>> { |
581 | | - let mut default_ancestors = HashSet::new(); |
| 581 | + let mut default_ancestors = HashSet::default(); |
582 | 582 | let ancestors = ancestors.unwrap_or(&mut default_ancestors); |
583 | 583 | let symlink_depth = symlink_depth.unwrap_or(0); |
584 | 584 | // Maximum symlink depth to prevent infinite loops |
@@ -995,7 +995,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { |
995 | 995 | files.collect() |
996 | 996 | } else { |
997 | 997 | // Deduplicate while preserving order |
998 | | - let mut seen = HashSet::new(); |
| 998 | + let mut seen = HashSet::default(); |
999 | 999 | files |
1000 | 1000 | .filter(|path| seen.insert(path.clone())) |
1001 | 1001 | .collect::<Vec<_>>() |
@@ -1088,7 +1088,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { |
1088 | 1088 | let printing_thread = thread::spawn(move || stat_printer.print_stats(&rx)); |
1089 | 1089 |
|
1090 | 1090 | // Check existence of path provided in argument |
1091 | | - let mut seen_inodes: HashSet<FileInfo> = HashSet::new(); |
| 1091 | + let mut seen_inodes: HashSet<FileInfo> = HashSet::default(); |
1092 | 1092 |
|
1093 | 1093 | 'loop_file: for path in files { |
1094 | 1094 | // Skip if we don't want to ignore anything |
|
0 commit comments