Skip to main content

preview

Function preview 

Source
pub fn preview(text: &str, max_chars: usize) -> String
Expand description

Cuts text to at most max_chars characters at a word boundary, adding an ellipsis when cut.