Skip to main content

parser_span_to_text_range

Function parser_span_to_text_range 

Source
pub fn parser_span_to_text_range(source: &str, span: Span) -> TextRange
Expand description

Convert a parser span into a text-size byte range for an arbitrary source string.

This is a convenience wrapper around try_parser_span_to_text_range for spans that are expected to be valid.

ยงPanics

Panics when span does not map to valid UTF-8 source bytes in source.