pub fn lookup_line(&self, pos: BytePos) -> Option<usize> {
        if self.lines.is_empty() {
            return None;
        }

        let line_index = lookup_line(&self.lines[..], pos);
        assert!(line_index < self.lines.len() as isize);
        if line_index >= 0 { Some(line_index as usize) } else { None }
    }
/// Finds the line containing the given position. The return value is the
/// index into the `lines` array of this `SourceFile`, not the 1-based line
/// number. If the source_file is empty or the position is located before the
/// first line, `None` is returned.
Finds the line containing the given position. The return value is the
index into the `lines` array of this `SourceFile`, not the 1-based line
number. If the source_file is empty or the position is located before the
first line, `None` is returned.
Finds the line containing the given position . The return value is the index into the ` lines ` array of this ` SourceFile ` not the 1 - based line number . If the source_file is empty or the position is located before the first line ` None ` is returned .
pub fn lookup_line(&self, pos: BytePos) -> Option<usize> {
        if self.lines.is_empty() {
            return None;
        }
        let line_index = lookup_line(&self.lines[..], pos);
        assert!(line_index < self.lines.len() as isize);
        if line_index >= 0 { Some(line_index as usize) } else { None }
    }
pub fn lookup_line ( & self , pos : BytePos ) -> Option < usize > { if self . lines . is_empty ( ) { return None ; } let line_index = lookup_line ( & self . lines [ .. ] , pos ) ; assert ! ( line_index self lines len ( ) as isize ) ; if line_index >= 0 { Some ( line_index as usize ) } else { None } }
Finds the line containing the given position.
Finds the line containing the given position .
&self
pos
BytePos
&self
pos
BytePos