Function wrap_impl

Source
pub fn wrap_impl(value: &str, soft_width: usize, hard_width: usize) -> String
Expand description

We can’t use textwrap::fill here because it will prefer to break a line rather than finding stuff that fits. We use a simple algorithm that tries to fill up to the desired width, allowing for overflow if there is a word that is too long to fit in the header, but breaking after a hard limit threshold.