Skip to main content

safe_head

Function safe_head 

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

Returns the longest prefix of s that is at most max_bytes long and ends on a UTF-8 boundary.