Skip to main content

code_preview

Function code_preview 

Source
pub fn code_preview(code: &str) -> String
Expand description

Create a code preview (first N bytes, with ellipsis if truncated).

Truncates at a valid UTF-8 char boundary to avoid panics on multibyte characters.