truncate_utf8_at_boundary

Function truncate_utf8_at_boundary 

Source
pub fn truncate_utf8_at_boundary(s: &str, max_bytes: usize) -> &str
Expand description

Truncates UTF-8 text to a max byte length at a valid char boundary.