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

Method peek

crates/css_parse/src/parser.rs:175–177  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

173 }
174
175 pub fn peek<T: Peek<'a>>(&self) -> bool {
176 T::peek(self, self.peek_n(1))
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) }

Callers 6

fmt_compacted_identMethod · 0.45
fmt_compacted_stringMethod · 0.45
eq_ignore_ascii_caseMethod · 0.45
parseMethod · 0.45
parse_ascii_lowerMethod · 0.45
parseMethod · 0.45

Calls 1

peek_nMethod · 0.80

Tested by

no test coverage detected