fn formula(&mut self) -> Result<Option<Formula>> {
    if self.cur_opt() != Some(b'$') {
      return Ok(None)
    }
    let start = self.idx;
    self.idx += 1;
    while self.idx < self.source.len() {
      let c = self.cur();
      self.idx += 1;
      if c == b'$' {
        let end = self.idx;
        self.ws();
        return Ok(Some(Formula((start..end).into())))
      }
    }
    Err(ParseError::new(
      start..mem::replace(&mut self.idx, start),
      "unclosed formula literal".into(),
    ))
  }
/// Attempt to parse a `$ .. $` delimited formula.
/// On success, advances the parser past the formula and any trailing whitespace.
/// On failure, does not advance the parser.
Attempt to parse a `$ .. $` delimited formula.
On success, advances the parser past the formula and any trailing whitespace.
On failure, does not advance the parser.
Attempt to parse a ` $ .. $ ` delimited formula . On success advances the parser past the formula and any trailing whitespace . On failure does not advance the parser .
fn formula(&mut self) -> Result<Option<Formula>> {
    if self.cur_opt() != Some(b'$') {
      return Ok(None)
    }
    let start = self.idx;
    self.idx += 1;
    while self.idx < self.source.len() {
      let c = self.cur();
      self.idx += 1;
      if c == b'$' {
        let end = self.idx;
        self.ws();
        return Ok(Some(Formula((start..end).into())))
      }
    }
    Err(ParseError::new(
      start..mem::replace(&mut self.idx, start),
      "unclosed formula literal".into(),
    ))
  }
fn formula ( & mut self ) -> Result < Option < Formula > > { if self . cur_opt ( ) != Some ( b'$' ) { return Ok ( None ) } let start = self . idx ; self . idx += 1 ; while self . idx < self . source . len ( ) { let c = self . cur ( ) ; self . idx += 1 ; if c == b'$' { let end = self . idx ; self . ws ( ) ; return Ok ( Some ( Formula ( ( start .. end ) . into ( ) ) ) ) } } Err ( ParseError :: new ( start .. mem :: replace ( & mut self . idx , start ) , " " . into ( ) , ) ) }
Attempt to parse a `$ .. $` delimited formula.
Attempt to parse a ` $ .. $ ` delimited formula .
&mut self
&mut self