Skip to content

Commit 46a1d70

Browse files
committed
Simplify RefTokenTreeCursor::look_ahead.
It's only ever used with a lookahead of 0, so this commit removes the lookahead and renames it `peek`.
1 parent de1c33c commit 46a1d70

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,7 @@ impl<'a> MacroParser<'a> {
11901190
// (`(` ... `)` `=>` `{` ... `}`)*
11911191
fn parse(&mut self) -> Option<Macro> {
11921192
let mut branches = vec![];
1193-
while self.toks.look_ahead(0).is_some() {
1193+
while self.toks.peek().is_some() {
11941194
branches.push(self.parse_branch()?);
11951195
}
11961196

@@ -1237,7 +1237,7 @@ impl<'a> MacroParser<'a> {
12371237
span,
12381238
},
12391239
_,
1240-
)) = self.toks.look_ahead(0)
1240+
)) = self.toks.peek()
12411241
{
12421242
hi = span.hi();
12431243
self.toks.next();

0 commit comments

Comments
 (0)