mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
ls: remove duplicate code
This commit is contained in:
parent
8866ec3927
commit
c3fea933e1
1 changed files with 6 additions and 11 deletions
|
@ -2576,7 +2576,11 @@ fn display_items(
|
||||||
|
|
||||||
for item in items {
|
for item in items {
|
||||||
#[cfg(unix)]
|
#[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(
|
let more_info = display_additional_leading_info(
|
||||||
item,
|
item,
|
||||||
&padding_collection,
|
&padding_collection,
|
||||||
|
@ -2586,16 +2590,7 @@ fn display_items(
|
||||||
|
|
||||||
write!(state.out, "{more_info}")?;
|
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)?;
|
display_item_long(item, &padding_collection, config, state, dired, quoted)?;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue