fn lookup_line(lines: &[BytePos], pos: BytePos) -> isize {
    match lines.binary_search(&pos) {
        Ok(line) => line as isize,
        Err(line) => line as isize - 1
    }
}
// Given a slice of line start positions and a position, returns the index of
// the line the position is on. Returns -1 if the position is located before
// the first line.
Given a slice of line start positions and a position, returns the index of
the line the position is on. Returns -1 if the position is located before
the first line.
Given a slice of line start positions and a position returns the index of the line the position is on . Returns - 1 if the position is located before the first line .
fn lookup_line(lines: &[BytePos], pos: BytePos) -> isize {
    match lines.binary_search(&pos) {
        Ok(line) => line as isize,
        Err(line) => line as isize - 1
    }
}
fn lookup_line ( lines : & [ BytePos ] , pos : BytePos ) -> isize { match lines . binary_search ( & pos ) { Ok ( line ) => line as isize , Err ( line ) => line as isize - 1 } }
Given a slice of line start positions and a position, returns the index of
the line the position is on.
Given a slice of line start positions and a position returns the index of the line the position is on .
lines
&[BytePos]
pos
BytePos
lines
&[BytePos]
pos
BytePos