diff options
author | andy.boot <bootandy@gmail.com> | 2023-01-04 19:55:04 +0000 |
---|---|---|
committer | andy.boot <bootandy@gmail.com> | 2023-01-04 20:08:20 +0000 |
commit | a91aa62060e7c5b20c26162ab8ea39f4f6efbf4d (patch) | |
tree | 390c233a597897e4861a9424ef0973d15fb50eaf | |
parent | a7b82f32d7f90b54aa21fa1d0f7bb7a559681e99 (diff) |
clippy: Fix new clippy
-rw-r--r-- | src/display.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/display.rs b/src/display.rs index 332f0b8..356a683 100644 --- a/src/display.rs +++ b/src/display.rs @@ -88,7 +88,7 @@ impl DrawData<'_> { let mut num_not_my_bar = (chars_in_bar as i32) - num_bars as i32; let mut new_bar = "".to_string(); - let idx = 5 - min(4, max(1, level)); + let idx = 5 - level.clamp(1, 4); for c in self.percent_bar.chars() { num_not_my_bar -= 1; @@ -141,10 +141,10 @@ pub fn draw_it( let longest_string_length = find_longest_dir_name(root_node, num_indent_chars, allowed_width, !use_full_path); - let max_bar_length = if no_percent_bars || longest_string_length + 7 >= allowed_width as usize { + let max_bar_length = if no_percent_bars || longest_string_length + 7 >= allowed_width { 0 } else { - allowed_width as usize - longest_string_length - 7 + allowed_width - longest_string_length - 7 }; let first_size_bar = repeat(BLOCKS[0]).take(max_bar_length).collect(); |