truncate_to_byte_limit

Function truncate_to_byte_limit 

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

Truncates the string at a character boundary, such that the result is less than max_bytes in length.