File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed
Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -442,23 +442,19 @@ fn safe_du(
442442 // Handle symlinks with -L option
443443 // For safe traversal with -L, we skip symlinks to directories entirely
444444 // and let the non-safe traversal handle them at the top level
445- let ( entry_stat , is_dir ) = if is_symlink && options. dereference == Deref :: All {
445+ if is_symlink && options. dereference == Deref :: All {
446446 // Skip symlinks to directories when using safe traversal with -L
447447 // They will be handled by regular traversal
448448 continue ;
449- } else {
450- let is_dir = ( lstat. st_mode & S_IFMT ) == S_IFDIR ;
451- ( lstat, is_dir)
452- } ;
449+ }
453450
454- let file_info = if entry_stat. st_ino != 0 {
455- Some ( FileInfo {
456- file_id : entry_stat. st_ino as u128 ,
457- dev_id : entry_stat. st_dev ,
458- } )
459- } else {
460- None
461- } ;
451+ let is_dir = ( lstat. st_mode & S_IFMT ) == S_IFDIR ;
452+ let entry_stat = lstat;
453+
454+ let file_info = ( entry_stat. st_ino != 0 ) . then_some ( FileInfo {
455+ file_id : entry_stat. st_ino as u128 ,
456+ dev_id : entry_stat. st_dev ,
457+ } ) ;
462458
463459 // For safe traversal, we need to handle stats differently
464460 // We can't use std::fs::Metadata since that requires the full path
You can’t perform that action at this time.
0 commit comments