Skip to main content

truncate_expr

Function truncate_expr 

Source
pub fn truncate_expr(expr: &str, max_len: usize) -> String
Expand description

Truncate an expression for display with ... suffix when required.

max_len is interpreted as a character limit (not bytes) to remain UTF-8 safe.