Skip to main content

line_col_to_offset

Function line_col_to_offset 

Source
pub fn line_col_to_offset(
    source: &str,
    line: usize,
    col: usize,
) -> Option<usize>
Expand description

Convert line and column numbers to a byte offset

Line and column are 0-indexed. Returns None if out of bounds.