Skip to main content

line_col

Function line_col 

Source
pub fn line_col(source: &str, offset: usize) -> (usize, usize)
Expand description

Converts a byte offset to a 1-based (line, column) pair for human-readable output. The column counts characters, not bytes, so it matches what most editors show.