MCPcopy Create free account
hub / github.com/denoland/rust-urlpattern / consume_required_token

Method consume_required_token

src/parser.rs:354–365  ·  view source on GitHub ↗
(
    &mut self,
    kind: TokenType,
  )

Source from the content-addressed store, hash-verified

352 // Ref: https://wicg.github.io/urlpattern/#consume-a-required-token
353 #[inline]
354 fn consume_required_token(
355 &mut self,
356 kind: TokenType,
357 ) -> Result<Token, Error> {
358 self.try_consume_token(kind.clone()).ok_or_else(|| {
359 Error::Parser(ParserError::ExpectedToken(
360 kind,
361 self.token_list[self.index].kind.clone(),
362 self.token_list[self.index].value.to_owned(),
363 ))
364 })
365 }
366}
367
368// Ref: https://wicg.github.io/urlpattern/#parse-a-pattern-string

Callers 1

parse_pattern_stringFunction · 0.80

Calls 1

try_consume_tokenMethod · 0.80

Tested by

no test coverage detected