Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit e20d5ab

Browse files
committed
Inline Printer's scan_pop method
1 parent 50d722a commit e20d5ab

File tree

1 file changed

+3
-7
lines changed
  • compiler/rustc_ast_pretty/src

1 file changed

+3
-7
lines changed

compiler/rustc_ast_pretty/src/pp.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,6 @@ impl Printer {
347347
}
348348
}
349349

350-
fn scan_pop(&mut self) -> usize {
351-
self.scan_stack.pop_front().unwrap()
352-
}
353-
354350
fn scan_top(&self) -> usize {
355351
*self.scan_stack.front().unwrap()
356352
}
@@ -396,19 +392,19 @@ impl Printer {
396392
match self.buf[x].token {
397393
Token::Begin(_) => {
398394
if k > 0 {
399-
self.scan_pop();
395+
self.scan_stack.pop_front().unwrap();
400396
self.buf[x].size += self.right_total;
401397
self.check_stack(k - 1);
402398
}
403399
}
404400
Token::End => {
405401
// paper says + not =, but that makes no sense.
406-
self.scan_pop();
402+
self.scan_stack.pop_front().unwrap();
407403
self.buf[x].size = 1;
408404
self.check_stack(k + 1);
409405
}
410406
_ => {
411-
self.scan_pop();
407+
self.scan_stack.pop_front().unwrap();
412408
self.buf[x].size += self.right_total;
413409
if k > 0 {
414410
self.check_stack(k);

0 commit comments

Comments
 (0)