Skip to main content

line_bounds

Function line_bounds 

Source
fn line_bounds(src: &str, at: usize) -> (usize, usize)
Expand description

Returns the start and end byte offsets of the line containing at.

This function helps us navigate the given document. We usually start somewhere in the middle of the input, without any knowledge of what’s around the current span/pointer.