panic fix in tui

This commit is contained in:
Dhanji R. Prasanna
2025-10-13 21:49:22 +11:00
parent 627fdcd9bf
commit a914afedd8

View File

@@ -42,7 +42,7 @@ impl SimpleOutput {
pub fn print_context(&self, used: u32, total: u32, percentage: f32) {
let bar_width = 10;
let filled_width = ((percentage / 100.0) * bar_width as f32) as usize;
let empty_width = bar_width - filled_width;
let empty_width = bar_width.saturating_sub(filled_width);
let filled_chars = "".repeat(filled_width);
let empty_chars = "".repeat(empty_width);