Skip to content

Commit a96ef96

Browse files
committed
Change the lookahead in MacroParser::new.
As it happens, lookahead values of 0, 1, and 2 all work fine here, due to the structure of the code. (Values or 3 or greater cause test failures.) This commit changes the lookahead to zero because that will facilitate cleanups in subsequent commits.
1 parent 33c245b commit a96ef96

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tools/rustfmt/src/macros.rs

Lines changed: 1 addition & 1 deletion
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(1).is_some() {
1193+
while self.toks.look_ahead(0).is_some() {
11941194
branches.push(self.parse_branch()?);
11951195
}
11961196

0 commit comments

Comments
 (0)