File tree 1 file changed +6
-8
lines changed
1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -1032,13 +1032,6 @@ impl<'a> Parser<'a> {
1032
1032
self . check_unknown_macro_variable ( ) ;
1033
1033
}
1034
1034
1035
- /// Advance the parser by one token and return the bumped token.
1036
- pub fn bump_and_get ( & mut self ) -> token:: Token {
1037
- let old_token = mem:: replace ( & mut self . token , token:: Underscore ) ;
1038
- self . bump ( ) ;
1039
- old_token
1040
- }
1041
-
1042
1035
/// Advance the parser using provided token as a next one. Use this when
1043
1036
/// consuming a part of a token. For example a single `<` from `<<`.
1044
1037
pub fn bump_with ( & mut self ,
@@ -2663,7 +2656,12 @@ impl<'a> Parser<'a> {
2663
2656
} ) ) ;
2664
2657
} ,
2665
2658
token:: CloseDelim ( _) | token:: Eof => unreachable ! ( ) ,
2666
- _ => Ok ( TokenTree :: Token ( self . span , self . bump_and_get ( ) ) ) ,
2659
+ _ => {
2660
+ let token = mem:: replace ( & mut self . token , token:: Underscore ) ;
2661
+ let res = Ok ( TokenTree :: Token ( self . span , token) ) ;
2662
+ self . bump ( ) ;
2663
+ res
2664
+ }
2667
2665
}
2668
2666
}
2669
2667
You can’t perform that action at this time.
0 commit comments