From a914afedd842e3a6c1df789121a18617dce7a6c2 Mon Sep 17 00:00:00 2001 From: "Dhanji R. Prasanna" Date: Mon, 13 Oct 2025 21:49:22 +1100 Subject: [PATCH] panic fix in tui --- crates/g3-cli/src/tui.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/g3-cli/src/tui.rs b/crates/g3-cli/src/tui.rs index c1202c7..cf9629a 100644 --- a/crates/g3-cli/src/tui.rs +++ b/crates/g3-cli/src/tui.rs @@ -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);