Skip to main content

bar

Function bar 

Source
pub fn bar(fraction: f64, width: usize) -> String
Expand description

A proportional bar. width cells; the fill is clamped, so an over-budget prompt shows a full bar rather than a panic or a negative count.

A tiny but non-zero fill would otherwise round to nothing and read as “empty”, so it gets a one-eighth block — the smallest thing that is still true.