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

Commit 2a14275

Browse files
committed
Inline Printer's scan_top method
1 parent e20d5ab commit 2a14275

File tree

1 file changed

+1
-5
lines changed
  • compiler/rustc_ast_pretty/src

1 file changed

+1
-5
lines changed

compiler/rustc_ast_pretty/src/pp.rs

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

350-
fn scan_top(&self) -> usize {
351-
*self.scan_stack.front().unwrap()
352-
}
353-
354350
fn scan_pop_bottom(&mut self) -> usize {
355351
self.scan_stack.pop_back().unwrap()
356352
}
@@ -388,7 +384,7 @@ impl Printer {
388384

389385
fn check_stack(&mut self, k: usize) {
390386
if !self.scan_stack.is_empty() {
391-
let x = self.scan_top();
387+
let x = *self.scan_stack.front().unwrap();
392388
match self.buf[x].token {
393389
Token::Begin(_) => {
394390
if k > 0 {

0 commit comments

Comments
 (0)