Skip to main content

extract_snippet

Function extract_snippet 

Source
pub fn extract_snippet(input: &[u8], offset: usize) -> String
Expand description

Extract a snippet of input around the error location

Returns up to MAX_SNIPPET_LENGTH characters centered around the offset, with invalid UTF-8 bytes replaced with replacement characters.