truncate_text

Function truncate_text 

Source
pub fn truncate_text(text: &str, max_bytes: usize) -> (&str, bool)
Expand description

Truncates text to a maximum byte length, appending a truncation notice.

Returns (truncated_text, was_truncated).