pub fn truncate(s: &str, max_len: usize) -> StringExpand description
Truncates a string to max_len characters, appending “…” if truncated.
§Examples
use gor::cmd::util::truncate;
assert_eq!(truncate("hello", 10), "hello");
assert_eq!(truncate("hello world", 5), "hello…");