pub fn truncate(s: &str, max_len: usize) -> String
Truncates a string to the given maximum length, appending a marker if truncation occurred.