Skip to main content

truncate_text

Function truncate_text 

Source
pub fn truncate_text(text: &str, max_width: usize) -> Cow<'_, str>
Expand description

Truncates text to fit within max_width display columns, appending “…” if truncated. Returns the original string borrowed when no truncation is needed.