truncate_to_max_bytes

Function truncate_to_max_bytes 

Source
pub fn truncate_to_max_bytes(s: &str, max_len: usize) -> String
Expand description

Truncate a string to a maximum byte length, respecting UTF-8 boundaries.