pub fn read_match(
        &self,
        mat: &mut Match,
        buf: &[u8],
        mut start: usize,
    ) -> bool {
        if start >= buf.len() {
            return false;
        }
        if let Some(ref req) = self.required {
            while start < buf.len() {
                let e = match req.shortest_match(&buf[start..]) {
                    None => return false,
                    Some(e) => start + e,
                };
                let (prevnl, nextnl) = self.find_line(buf, e, e);
                match self.re.shortest_match(&buf[prevnl..nextnl]) {
                    None => {
                        start = nextnl;
                        continue;
                    }
                    Some(_) => {
                        self.fill_match(mat, prevnl, nextnl);
                        return true;
                    }
                }
            }
            false
        } else {
            let e = match self.re.shortest_match(&buf[start..]) {
                None => return false,
                Some(e) => start + e,
            };
            let (s, e) = self.find_line(buf, e, e);
            self.fill_match(mat, s, e);
            true
        }
    }
/// Fills in the next line that matches in the given buffer starting at
/// the position given.
///
/// If no match could be found, `false` is returned, otherwise, `true` is
/// returned.
Fills in the next line that matches in the given buffer starting at
the position given.

If no match could be found, `false` is returned, otherwise, `true` is
returned.
Fills in the next line that matches in the given buffer starting at the position given . If no match could be found ` false ` is returned otherwise ` true ` is returned .
pub fn read_match(
        &self,
        mat: &mut Match,
        buf: &[u8],
        mut start: usize,
    ) -> bool {
        if start >= buf.len() {
            return false;
        }
        if let Some(ref req) = self.required {
            while start < buf.len() {
                let e = match req.shortest_match(&buf[start..]) {
                    None => return false,
                    Some(e) => start + e,
                };
                let (prevnl, nextnl) = self.find_line(buf, e, e);
                match self.re.shortest_match(&buf[prevnl..nextnl]) {
                    None => {
                        start = nextnl;
                        continue;
                    }
                    Some(_) => {
                        self.fill_match(mat, prevnl, nextnl);
                        return true;
                    }
                }
            }
            false
        } else {
            let e = match self.re.shortest_match(&buf[start..]) {
                None => return false,
                Some(e) => start + e,
            };
            let (s, e) = self.find_line(buf, e, e);
            self.fill_match(mat, s, e);
            true
        }
    }
pub fn read_match ( & self , mat : & mut Match , buf : & [ u8 ] , mut start : usize , ) -> bool { if start >= buf . len ( ) { return false ; } if let Some ( ref req ) = self . required { while start < buf . len ( ) { let e = match req . shortest_match ( & buf [ start .. ] ) { None => return false , Some ( e ) => start + e , } ; let ( prevnl , nextnl ) = self . find_line ( buf , e , e ) ; match self . re . shortest_match ( & buf [ prevnl .. nextnl ] ) { None => { start = nextnl ; continue ; } Some ( _ ) => { self . fill_match ( mat , prevnl , nextnl ) ; return true ; } } } false } else { let e = match self . re . shortest_match ( & buf [ start .. ] ) { None => return false , Some ( e ) => start + e , } ; let ( s , e ) = self . find_line ( buf , e , e ) ; self . fill_match ( mat , s , e ) ; true } }
Fills in the next line that matches in the given buffer starting at
the position given.
Fills in the next line that matches in the given buffer starting at the position given .
&self
mat
&mut Match
buf
&[u8]
start
usize