diff options
Diffstat (limited to 'src/canvas/widgets/mem_basic.rs')
-rw-r--r-- | src/canvas/widgets/mem_basic.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/canvas/widgets/mem_basic.rs b/src/canvas/widgets/mem_basic.rs index 132fd91d..7c1b749a 100644 --- a/src/canvas/widgets/mem_basic.rs +++ b/src/canvas/widgets/mem_basic.rs @@ -1,5 +1,3 @@ -use std::cmp::max; - use crate::{ app::App, canvas::{drawing_utils::*, Painter}, @@ -41,7 +39,7 @@ impl MemBasicWidget for Painter { } // +9 due to 3 + 4 + 2 + 2 columns for the name & space + percentage + bar bounds + margin spacing - let bar_length = max(0, draw_loc.width as i64 - 11) as usize; + let bar_length = draw_loc.width.saturating_sub(11) as usize; let ram_use_percentage = if let Some(mem) = mem_data.last() { mem.1 } else { |