Skip to content

Commit 3924d09

Browse files
sylvestrecakebaker
authored andcommitted
ls: inline calculate_line_len into update_dired_for_item
1 parent db4fcfe commit 3924d09

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/uu/ls/src/display.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -557,10 +557,6 @@ fn display_additional_leading_info(
557557
Ok(())
558558
}
559559

560-
fn calculate_line_len(output_len: usize, item_len: usize) -> usize {
561-
output_len + item_len + 1 // line ending
562-
}
563-
564560
// Currently getpwuid is `linux` target only. If it's broken state.out into
565561
// a posix-compliant attribute this can be updated...
566562
#[cfg(unix)]
@@ -1210,7 +1206,7 @@ fn update_dired_for_item(
12101206
displayed_len: usize,
12111207
dired_name_len: usize,
12121208
) {
1213-
let line_len = calculate_line_len(output_display_len, displayed_len);
1209+
let line_len = output_display_len + displayed_len + 1; // +1 for line ending
12141210
dired::calculate_and_update_positions(dired, output_display_len, dired_name_len, line_len);
12151211
}
12161212

0 commit comments

Comments
 (0)