panic fix in tui
This commit is contained in:
@@ -42,7 +42,7 @@ impl SimpleOutput {
|
|||||||
pub fn print_context(&self, used: u32, total: u32, percentage: f32) {
|
pub fn print_context(&self, used: u32, total: u32, percentage: f32) {
|
||||||
let bar_width = 10;
|
let bar_width = 10;
|
||||||
let filled_width = ((percentage / 100.0) * bar_width as f32) as usize;
|
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 filled_chars = "●".repeat(filled_width);
|
||||||
let empty_chars = "○".repeat(empty_width);
|
let empty_chars = "○".repeat(empty_width);
|
||||||
|
|||||||
Reference in New Issue
Block a user