Skip to main content

elide_end

Function elide_end 

Source
pub fn elide_end<'a>(
    text: &'a str,
    ellipsis: &'a str,
    max_width: usize,
) -> (Cow<'a, str>, usize)
Expand description

Shortens text to max_width by removing trailing characters. ellipsis is added if the text gets truncated.

The returned string (including ellipsis) never exceeds the max_width.