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

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