wrap_impl

Function wrap_impl 

Source
pub fn wrap_impl(
    value: impl AsRef<BStr>,
    soft_width: usize,
    hard_width: usize,
) -> Vec<u8> 
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.