@@ -549,37 +549,37 @@ impl<'a> Parser<'a> {
549
549
}
550
550
}
551
551
552
- fn check_or_expected ( & mut self , ok : bool , mk_type : impl FnOnce ( ) -> TokenType ) -> bool {
552
+ fn check_or_expected ( & mut self , ok : bool , typ : TokenType ) -> bool {
553
553
if ok {
554
554
true
555
555
} else {
556
- self . expected_tokens . push ( mk_type ( ) ) ;
556
+ self . expected_tokens . push ( typ ) ;
557
557
false
558
558
}
559
559
}
560
560
561
561
crate fn check_ident ( & mut self ) -> bool {
562
- self . check_or_expected ( self . token . is_ident ( ) , || TokenType :: Ident )
562
+ self . check_or_expected ( self . token . is_ident ( ) , TokenType :: Ident )
563
563
}
564
564
565
565
fn check_path ( & mut self ) -> bool {
566
- self . check_or_expected ( self . token . is_path_start ( ) , || TokenType :: Path )
566
+ self . check_or_expected ( self . token . is_path_start ( ) , TokenType :: Path )
567
567
}
568
568
569
569
fn check_type ( & mut self ) -> bool {
570
- self . check_or_expected ( self . token . can_begin_type ( ) , || TokenType :: Type )
570
+ self . check_or_expected ( self . token . can_begin_type ( ) , TokenType :: Type )
571
571
}
572
572
573
573
fn check_const_arg ( & mut self ) -> bool {
574
- self . check_or_expected ( self . token . can_begin_const_arg ( ) , || TokenType :: Const )
574
+ self . check_or_expected ( self . token . can_begin_const_arg ( ) , TokenType :: Const )
575
575
}
576
576
577
577
/// Checks to see if the next token is either `+` or `+=`.
578
578
/// Otherwise returns `false`.
579
579
fn check_plus ( & mut self ) -> bool {
580
580
self . check_or_expected (
581
581
self . token . is_like_plus ( ) ,
582
- || TokenType :: Token ( token:: BinOp ( token:: Plus ) ) ,
582
+ TokenType :: Token ( token:: BinOp ( token:: Plus ) ) ,
583
583
)
584
584
}
585
585
0 commit comments