@@ -362,7 +362,7 @@ fn is_emfile(e: &io::Error) -> bool {
362362/// A frame starts as `Live` (fd open, lazy iteration via `DirIter`). When
363363/// the process runs out of file descriptors — which limits tree depth to
364364/// approximately `RLIMIT_NOFILE` (≈ 1 024) — `try_reclaim_fd` demotes the
365- /// oldest live frame to `Drained` by materialising its remaining entries into
365+ /// oldest live frame to `Drained` by materializing its remaining entries into
366366/// a `Vec` and closing the fd. Subsequent entry-yielding uses the vec; fd
367367/// operations (stat, unlink, open-child) temporarily re-open the directory
368368/// from `StackFrame::dir_path`.
@@ -419,7 +419,7 @@ struct StackFrame {
419419/// Returns `true` if a frame was demoted; `false` if all non-top frames are
420420/// already `Drained` (which means we are genuinely out of fds).
421421///
422- /// Materialising the oldest frame first minimises the chance of collecting a
422+ /// Materializing the oldest frame first minimizes the chance of collecting a
423423/// large sibling list: for deep linear chains the bottom frames have already
424424/// exhausted their children before a new level is pushed.
425425///
@@ -562,7 +562,7 @@ pub(super) fn safe_remove_dir_recursive_impl(
562562 options : & Options ,
563563 progress_bar : Option < & ProgressBar > ,
564564) -> bool {
565- // Iterative, allocation-minimising implementation.
565+ // Iterative, allocation-minimizing implementation.
566566 //
567567 // Design goals (see https://github.com/uutils/coreutils/issues/11222):
568568 // • One shared `PathBuf` for the entire traversal instead of one `join()`
@@ -577,7 +577,7 @@ pub(super) fn safe_remove_dir_recursive_impl(
577577 //
578578 // Fd budget: each `Live` frame holds exactly one open fd. When the process
579579 // runs out of file descriptors (`EMFILE`/`ENFILE`), `try_reclaim_fd` demotes
580- // the oldest live frame to `Drained` — its remaining entries are materialised
580+ // the oldest live frame to `Drained` — its remaining entries are materialized
581581 // into a `Vec<OsString>` and its fd is closed. Subsequent fd-requiring
582582 // operations on a `Drained` frame re-open the directory from `dir_path` on
583583 // demand. This allows traversal of trees of arbitrary depth at the cost of
@@ -681,7 +681,7 @@ pub(super) fn safe_remove_dir_recursive_impl(
681681
682682 // ── Normal child entry ────────────────────────────────────────────
683683 Some ( Ok ( entry) ) => {
684- // Extend the shared path accumulator in-place — amortised O(1),
684+ // Extend the shared path accumulator in-place — amortized O(1),
685685 // no heap allocation if there is spare capacity.
686686 current_path. push ( & entry. name ) ;
687687
@@ -696,19 +696,18 @@ pub(super) fn safe_remove_dir_recursive_impl(
696696 //
697697 // Fallback: stat when in interactive mode (need mode/size for
698698 // the prompt) or when the filesystem reports DT_UNKNOWN.
699- let needs_stat = options . interactive != InteractiveMode :: Never
700- || entry. file_type . is_none ( ) ;
699+ let needs_stat =
700+ options . interactive != InteractiveMode :: Never || entry. file_type . is_none ( ) ;
701701
702702 let ( is_dir, stat_opt) = if needs_stat {
703703 match frame_stat_at ( stack. last ( ) . unwrap ( ) , entry. name . as_ref ( ) ) {
704704 Ok ( s) => {
705- let is_dir = ( ( s . st_mode as libc :: mode_t ) & libc :: S_IFMT )
706- == libc:: S_IFDIR ;
705+ let is_dir =
706+ ( ( s . st_mode as libc :: mode_t ) & libc :: S_IFMT ) == libc:: S_IFDIR ;
707707 ( is_dir, Some ( s) )
708708 }
709709 Err ( e) => {
710- let err =
711- handle_error_with_force ( e, current_path. as_path ( ) , options) ;
710+ let err = handle_error_with_force ( e, current_path. as_path ( ) , options) ;
712711 stack. last_mut ( ) . unwrap ( ) . had_error |= err;
713712 current_path. pop ( ) ;
714713 continue ;
@@ -832,9 +831,7 @@ pub(super) fn safe_remove_dir_recursive_impl(
832831 // File or symlink: prompt then unlink.
833832 // In Never mode stat_opt is None and we always remove.
834833 let should_remove = match stat_opt {
835- Some ( ref s) => {
836- prompt_file_with_stat ( current_path. as_path ( ) , s, options)
837- }
834+ Some ( ref s) => prompt_file_with_stat ( current_path. as_path ( ) , s, options) ,
838835 None => true ,
839836 } ;
840837 if should_remove {
0 commit comments