pub fn wrap_text(text: &str, width: usize) -> Vec<Cow<'_, str>>
Expand description
Wraps the given text to fit within the specified line width.
This function uses the English US hyphenation dictionary to split words across lines when necessary. The returned value is a Vec of Cow<’a, str> where each entry represents a single line of wrapped text.
Arguments
- text - The input text to wrap
- width - The maximum line width for the wrapped text
Returns
A Vec<Cow<’a, str>> containing the wrapped lines.