fn clamped_range(pd: &PositionalDiagnostic) -> Range<usize>Expand description
Clamp the byte range to [0, source.len()] so an out-of-bounds offset
(e.g. a parser pos past EOF) doesn’t panic inside annotate-snippets.
fn clamped_range(pd: &PositionalDiagnostic) -> Range<usize>Clamp the byte range to [0, source.len()] so an out-of-bounds offset
(e.g. a parser pos past EOF) doesn’t panic inside annotate-snippets.