glinter/source

Values

pub fn byte_offset_to_line(source: String, offset: Int) -> Int

Convert byte offset to line number (1-indexed)

pub fn line_to_byte_offset(source: String, line: Int) -> Int

Convert line number (1-indexed) to byte offset of the start of that line.

pub fn strip_prefix(path: String, prefix: String) -> String

Strip a prefix from a path, returning the relative portion.

Search Document