mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 11:07:44 +00:00
Merge pull request #7932 from cakebaker/ls_remove_duplicate_code
ls: remove duplicate code
This commit is contained in:
commit
5e11842428
1 changed files with 6 additions and 11 deletions
|
@ -2576,7 +2576,11 @@ fn display_items(
|
|||
|
||||
for item in items {
|
||||
#[cfg(unix)]
|
||||
if config.inode || config.alloc_size {
|
||||
let should_display_leading_info = config.inode || config.alloc_size;
|
||||
#[cfg(not(unix))]
|
||||
let should_display_leading_info = config.alloc_size;
|
||||
|
||||
if should_display_leading_info {
|
||||
let more_info = display_additional_leading_info(
|
||||
item,
|
||||
&padding_collection,
|
||||
|
@ -2586,16 +2590,7 @@ fn display_items(
|
|||
|
||||
write!(state.out, "{more_info}")?;
|
||||
}
|
||||
#[cfg(not(unix))]
|
||||
if config.alloc_size {
|
||||
let more_info = display_additional_leading_info(
|
||||
item,
|
||||
&padding_collection,
|
||||
config,
|
||||
&mut state.out,
|
||||
)?;
|
||||
write!(state.out, "{more_info}")?;
|
||||
}
|
||||
|
||||
display_item_long(item, &padding_collection, config, state, dired, quoted)?;
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue