Function elide_start

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

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

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