Skip to content

Commit a9d25f8

Browse files
committed
Refactor away parser.commit_stmt_expecting()
1 parent ea0dc92 commit a9d25f8

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/libsyntax/parse/parser.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -553,10 +553,6 @@ impl<'a> Parser<'a> {
553553
self.expect_one_of(edible, inedible)
554554
}
555555

556-
pub fn commit_stmt_expecting(&mut self, edible: token::Token) -> PResult<'a, ()> {
557-
self.commit_stmt(&[edible], &[])
558-
}
559-
560556
/// returns the span of expr, if it was not interpolated or the span of the interpolated token
561557
fn interpolated_or_expr_span(&self,
562558
expr: PResult<'a, P<Expr>>)
@@ -4122,7 +4118,7 @@ impl<'a> Parser<'a> {
41224118
_ => { // all other kinds of statements:
41234119
let mut hi = span.hi;
41244120
if classify::stmt_ends_with_semi(&node) {
4125-
self.commit_stmt_expecting(token::Semi)?;
4121+
self.commit_stmt(&[token::Semi], &[])?;
41264122
hi = self.last_span.hi;
41274123
}
41284124

0 commit comments

Comments
 (0)