pub fn truncate_byte_budget(
text: &str,
max_bytes: usize,
suffix: &str,
) -> StringExpand description
Truncate a string so that the retained prefix is at most max_bytes bytes,
rounded down to the nearest UTF-8 char boundary. Returns the truncated
prefix with suffix appended, or the original string when it already fits.