From eb00f02843db9d30bbf10aaee3434ed42a0f26fa Mon Sep 17 00:00:00 2001 From: Guilleag01 Date: Sun, 26 Nov 2023 10:06:58 +0100 Subject: [PATCH] changed a character --- src/out/list.rs | 4 ++-- src/utils.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/out/list.rs b/src/out/list.rs index d40c543..1d501f6 100644 --- a/src/out/list.rs +++ b/src/out/list.rs @@ -91,7 +91,7 @@ fn print_elements( &new_is_last_element, i == elements.len() - 1, " ", - "| ", + "│ ", ) } e_name.push_str(" "); @@ -184,7 +184,7 @@ fn print_footer(num_elements: usize, name_length: usize) { fn get_max_width(elements: &Vec, recursive_limit: usize, current_depth: usize) -> usize { let mut name_max_len = 0; for e in elements { - let mut length = get_string_length(e.to_string().as_str()) + current_depth * 2; + let mut length = e.to_string().chars().count() + current_depth * 2; if e.get_file_type() == TypeOfFile::Dir && current_depth < recursive_limit { let recursive_width = get_max_width( &get_elements_from_path(e.get_path_string(), true), diff --git a/src/utils.rs b/src/utils.rs index c86341d..7ea5173 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -77,7 +77,7 @@ pub fn system_time_to_string(system_time: SystemTime) -> String { datetime.format("%d-%m-%y %H:%M").to_string() } -pub fn sort_elements(elements: &mut Vec, sort_by: &SortBy) { +pub fn sort_elements(elements: &mut [Element], sort_by: &SortBy) { match sort_by { SortBy::NONE => (), SortBy::NAME => elements.sort_unstable_by_key(|a| a.get_name().to_lowercase()),