MCPcopy Create free account
hub / github.com/csskit/csskit / parse_if_peek

Method parse_if_peek

crates/css_parse/src/parser.rs:179–181  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

177 }
178
179 pub fn parse_if_peek<T: Peek<'a> + Parse<'a>>(&mut self) -> Result<Option<T>> {
180 if T::peek(self, self.peek_n(1)) { T::parse(self).map(Some) } else { Ok(None) }
181 }
182
183 pub fn try_parse<T: Parse<'a>>(&mut self) -> Result<T> {
184 T::try_parse(self)

Callers

nothing calls this directly

Calls 2

peek_nMethod · 0.80
parseFunction · 0.50

Tested by

no test coverage detected