pub fn wrap(text: &str, width: usize) -> String
Greedy hard wrap at width, breaking on spaces — the JS (?![^\n]{1,w}$)([^\n]{1,w})\s replace. A word longer than width is left intact rather than split.
width
(?![^\n]{1,w}$)([^\n]{1,w})\s