Skip to content

Commit 5e11842

Browse files
authored
Merge pull request #7932 from cakebaker/ls_remove_duplicate_code
ls: remove duplicate code
2 parents c76c0ad + c3fea93 commit 5e11842

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

src/uu/ls/src/ls.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2576,26 +2576,21 @@ fn display_items(
25762576

25772577
for item in items {
25782578
#[cfg(unix)]
2579-
if config.inode || config.alloc_size {
2580-
let more_info = display_additional_leading_info(
2581-
item,
2582-
&padding_collection,
2583-
config,
2584-
&mut state.out,
2585-
)?;
2586-
2587-
write!(state.out, "{more_info}")?;
2588-
}
2579+
let should_display_leading_info = config.inode || config.alloc_size;
25892580
#[cfg(not(unix))]
2590-
if config.alloc_size {
2581+
let should_display_leading_info = config.alloc_size;
2582+
2583+
if should_display_leading_info {
25912584
let more_info = display_additional_leading_info(
25922585
item,
25932586
&padding_collection,
25942587
config,
25952588
&mut state.out,
25962589
)?;
2590+
25972591
write!(state.out, "{more_info}")?;
25982592
}
2593+
25992594
display_item_long(item, &padding_collection, config, state, dired, quoted)?;
26002595
}
26012596
} else {

0 commit comments

Comments
 (0)