diff --git a/src/uu/ls/src/dired.rs b/src/uu/ls/src/dired.rs index 8e85a2e0f..288d7fc76 100644 --- a/src/uu/ls/src/dired.rs +++ b/src/uu/ls/src/dired.rs @@ -33,7 +33,7 @@ impl fmt::Display for BytePosition { static DIRED_TRAILING_OFFSET: usize = 2; /// Calculates the byte positions for DIRED -pub fn calculate_dired_byte_positions( +pub fn calculate_dired( output_display_len: usize, dfn_len: usize, dired_positions: &[BytePosition], @@ -143,12 +143,11 @@ mod tests { use super::*; #[test] - fn test_calculate_dired_byte_positions() { + fn test_calculate_dired() { let output_display = "sample_output".to_string(); let dfn = "sample_file".to_string(); let dired_positions = vec![BytePosition { start: 5, end: 10 }]; - let (start, end) = - calculate_dired_byte_positions(output_display.len(), dfn.len(), &dired_positions); + let (start, end) = calculate_dired(output_display.len(), dfn.len(), &dired_positions); assert_eq!(start, 24); assert_eq!(end, 35); diff --git a/src/uu/ls/src/ls.rs b/src/uu/ls/src/ls.rs index 7f977da2a..f7a3b79ae 100644 --- a/src/uu/ls/src/ls.rs +++ b/src/uu/ls/src/ls.rs @@ -2545,7 +2545,7 @@ fn display_item_long( let displayed_file = display_file_name(item, config, None, String::new(), out).contents; if config.dired { - let (start, end) = dired::calculate_dired_byte_positions( + let (start, end) = dired::calculate_dired( output_display.len(), displayed_file.len(), &dired.dired_positions,