Skip to main content

truncate_for_diagnostics

Function truncate_for_diagnostics 

Source
pub(super) fn truncate_for_diagnostics(text: &str, limit: usize) -> String
Expand description

Truncates to limit characters, marking the cut with ....

Diagnostics carry user-controlled text; slicing by byte offset would panic in the middle of a multi-byte sequence.