mirror of
https://github.com/uutils/coreutils
synced 2024-12-14 07:12:44 +00:00
ls rename the function for consistency
This commit is contained in:
parent
8db6146dd3
commit
a12dd2ee1e
2 changed files with 4 additions and 5 deletions
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue