charon_lib::ast::meta_utils

Function line_to_start_byte

source
fn line_to_start_byte(source: &str, line_nbr: usize) -> usize
Expand description

Given a line number within a source file, get the byte of the start of the line. Obviously not efficient to do many times, but this is used is diagnostic paths only. The line numer is expected to be 1-based.