truncate_lines_to_byte_limit

Function truncate_lines_to_byte_limit 

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

Takes a prefix of complete lines which fit within the byte limit. If the first line is longer than the limit, truncates at a character boundary.