Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/uu/du/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ uucore = { workspace = true, features = [
"parser-glob",
"time",
] }
rustc-hash = { workspace = true }
thiserror = { workspace = true }
fluent = { workspace = true }

Expand Down
8 changes: 4 additions & 4 deletions src/uu/du/src/du.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

use clap::{Arg, ArgAction, ArgMatches, Command, builder::PossibleValue};
use glob::Pattern;
use std::collections::HashSet;
use rustc_hash::FxHashSet as HashSet;
use std::env;
use std::ffi::{OsStr, OsString};
use std::fs::{self, DirEntry, File, Metadata};
Expand Down Expand Up @@ -578,7 +578,7 @@ fn du_regular(
ancestors: Option<&mut HashSet<FileInfo>>,
symlink_depth: Option<usize>,
) -> Result<Stat, Box<mpsc::SendError<UResult<StatPrintInfo>>>> {
let mut default_ancestors = HashSet::new();
let mut default_ancestors = HashSet::default();
let ancestors = ancestors.unwrap_or(&mut default_ancestors);
let symlink_depth = symlink_depth.unwrap_or(0);
// Maximum symlink depth to prevent infinite loops
Expand Down Expand Up @@ -995,7 +995,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
files.collect()
} else {
// Deduplicate while preserving order
let mut seen = HashSet::new();
let mut seen = HashSet::default();
files
.filter(|path| seen.insert(path.clone()))
.collect::<Vec<_>>()
Expand Down Expand Up @@ -1088,7 +1088,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let printing_thread = thread::spawn(move || stat_printer.print_stats(&rx));

// Check existence of path provided in argument
let mut seen_inodes: HashSet<FileInfo> = HashSet::new();
let mut seen_inodes: HashSet<FileInfo> = HashSet::default();

'loop_file: for path in files {
// Skip if we don't want to ignore anything
Expand Down
Loading