mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 03:57: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;
|
static DIRED_TRAILING_OFFSET: usize = 2;
|
||||||
|
|
||||||
/// Calculates the byte positions for DIRED
|
/// Calculates the byte positions for DIRED
|
||||||
pub fn calculate_dired_byte_positions(
|
pub fn calculate_dired(
|
||||||
output_display_len: usize,
|
output_display_len: usize,
|
||||||
dfn_len: usize,
|
dfn_len: usize,
|
||||||
dired_positions: &[BytePosition],
|
dired_positions: &[BytePosition],
|
||||||
|
@ -143,12 +143,11 @@ mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_calculate_dired_byte_positions() {
|
fn test_calculate_dired() {
|
||||||
let output_display = "sample_output".to_string();
|
let output_display = "sample_output".to_string();
|
||||||
let dfn = "sample_file".to_string();
|
let dfn = "sample_file".to_string();
|
||||||
let dired_positions = vec![BytePosition { start: 5, end: 10 }];
|
let dired_positions = vec![BytePosition { start: 5, end: 10 }];
|
||||||
let (start, end) =
|
let (start, end) = calculate_dired(output_display.len(), dfn.len(), &dired_positions);
|
||||||
calculate_dired_byte_positions(output_display.len(), dfn.len(), &dired_positions);
|
|
||||||
|
|
||||||
assert_eq!(start, 24);
|
assert_eq!(start, 24);
|
||||||
assert_eq!(end, 35);
|
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;
|
let displayed_file = display_file_name(item, config, None, String::new(), out).contents;
|
||||||
if config.dired {
|
if config.dired {
|
||||||
let (start, end) = dired::calculate_dired_byte_positions(
|
let (start, end) = dired::calculate_dired(
|
||||||
output_display.len(),
|
output_display.len(),
|
||||||
displayed_file.len(),
|
displayed_file.len(),
|
||||||
&dired.dired_positions,
|
&dired.dired_positions,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue