fn doc_comment(&mut self) -> Option<(DocComment, usize)> {
    let mut doc = Vec::new();
    let mut end = mem::MaybeUninit::uninit();
    while self.source[self.idx..].starts_with(b"--|") {
      // move past `--|`
      self.idx += 3;
      // take everything up to the end of the line.
      let eol = {
        let slice = &self.source[self.idx..];
        match slice.iter().position(|&b| b == b'\n') {
          None => slice.len(),
          // Allow '\n' to be included so users make a linebreak by
          // inserting an empty doc comment line.
          Some(i) => i + 1,
        }
      };
      doc.extend_from_slice(&self.source[self.idx..self.idx + eol]);
      self.idx += eol;
      end = mem::MaybeUninit::new(self.idx);

      // Needed if doc comment lines are indented.
      while self.cur_opt() == Some(b' ') {
        self.idx += 1
      }
    }

    if doc.is_empty() {
      None
    } else {
      self.ws();
      Some((String::from_utf8(doc).ok()?.into(), unsafe { end.assume_init() }))
    }
  }
/// Parse and return a doc comment if one is present,
/// along with the index of the end of the comment.
/// If not, just return None.
Parse and return a doc comment if one is present,
along with the index of the end of the comment.
If not, just return None.
Parse and return a doc comment if one is present along with the index of the end of the comment . If not just return None .
fn doc_comment(&mut self) -> Option<(DocComment, usize)> {
    let mut doc = Vec::new();
    let mut end = mem::MaybeUninit::uninit();
    while self.source[self.idx..].starts_with(b"--|") {
      // move past `--|`
      self.idx += 3;
      // take everything up to the end of the line.
      let eol = {
        let slice = &self.source[self.idx..];
        match slice.iter().position(|&b| b == b'\n') {
          None => slice.len(),
          // Allow '\n' to be included so users make a linebreak by
          // inserting an empty doc comment line.
          Some(i) => i + 1,
        }
      };
      doc.extend_from_slice(&self.source[self.idx..self.idx + eol]);
      self.idx += eol;
      end = mem::MaybeUninit::new(self.idx);
      // Needed if doc comment lines are indented.
      while self.cur_opt() == Some(b' ') {
        self.idx += 1
      }
    }
    if doc.is_empty() {
      None
    } else {
      self.ws();
      Some((String::from_utf8(doc).ok()?.into(), unsafe { end.assume_init() }))
    }
  }
fn doc_comment ( & mut self ) -> Option < ( DocComment , usize ) > { let mut doc = Vec :: new ( ) ; let mut end = mem :: MaybeUninit :: uninit ( ) ; while self . source [ self . idx .. ] . starts_with ( b" " ) { // move past `--|` self . idx += 3 ; // take everything up to the end of the line. let eol = { let slice = & self . source [ self . idx .. ] ; match slice . iter ( ) . position ( | & b | b == b'\n' ) { None => slice . len ( ) , // Allow '\n' to be included so users make a linebreak by // inserting an empty doc comment line. Some ( i ) => i + 1 , } } ; doc . extend_from_slice ( & self . source [ self . idx .. self . idx + eol ] ) ; self . idx += eol ; end = mem :: MaybeUninit :: new ( self . idx ) ; // Needed if doc comment lines are indented. while self . cur_opt ( ) == Some ( b' ' ) { self . idx += 1 } } if doc . is_empty ( ) { None } else { self . ws ( ) ; Some ( ( String :: from_utf8 ( doc ) . ok ( ) ? . into ( ) , unsafe { end . assume_init ( ) } ) ) } }
Parse and return a doc comment if one is present,
along with the index of the end of the comment.
Parse and return a doc comment if one is present along with the index of the end of the comment .
&mut self
&mut self