Skip to content

Commit 107877b

Browse files
committed
Update for simplified parser API.
The return type of `Parser::eat()` is no longer wrapped in a `Result`. See rust-lang/rust@9023c65 for the changes in libsyntax.
1 parent 92fb9fe commit 107877b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ fn expand_execute(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree])
8080

8181
let conn = parser.parse_expr().unwrap();
8282

83-
if !parser.eat(&Comma).ok().unwrap() {
83+
if !parser.eat(&Comma) {
8484
cx.span_err(parser.span, "expected `,`");
8585
return DummyResult::expr(sp);
8686
}
@@ -91,7 +91,7 @@ fn expand_execute(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree])
9191
None => return DummyResult::expr(sp),
9292
};
9393

94-
if parser.token != Eof && !parser.eat(&Comma).ok().unwrap() {
94+
if parser.token != Eof && !parser.eat(&Comma) {
9595
cx.span_err(parser.span, "expected `,`");
9696
return DummyResult::expr(sp);
9797
}
@@ -147,7 +147,7 @@ fn parse_args(cx: &mut ExtCtxt, parser: &mut Parser) -> Option<Vec<P<Expr>>> {
147147
while parser.token != Eof {
148148
args.push(parser.parse_expr().unwrap());
149149

150-
if !parser.eat(&Comma).ok().unwrap() && parser.token != Eof {
150+
if !parser.eat(&Comma) && parser.token != Eof {
151151
cx.span_err(parser.span, "expected `,`");
152152
return None;
153153
}

0 commit comments

Comments
 (0)