Skip to content

Commit 69899b7

Browse files
Inline function to avoid naming confusion.
1 parent ba07bd5 commit 69899b7

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/libsyntax/parse/parser.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -1032,13 +1032,6 @@ impl<'a> Parser<'a> {
10321032
self.check_unknown_macro_variable();
10331033
}
10341034

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-
10421035
/// Advance the parser using provided token as a next one. Use this when
10431036
/// consuming a part of a token. For example a single `<` from `<<`.
10441037
pub fn bump_with(&mut self,
@@ -2663,7 +2656,12 @@ impl<'a> Parser<'a> {
26632656
}));
26642657
},
26652658
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+
}
26672665
}
26682666
}
26692667

0 commit comments

Comments
 (0)