about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@gmail.com>2022-01-18 19:15:02 -0800
committerDavid Tolnay <dtolnay@gmail.com>2022-01-18 19:16:32 -0800
commite20d5abdfb39f38ac9f4919b053029ffb6560641 (patch)
tree317186affa59d35cfb9e311a97a255e3e0a0b049
parent50d722a6917eb150362ff05e4881e63b3e7adc62 (diff)
downloadrust-e20d5abdfb39f38ac9f4919b053029ffb6560641.tar.gz
rust-e20d5abdfb39f38ac9f4919b053029ffb6560641.zip
Inline Printer's scan_pop method
-rw-r--r--compiler/rustc_ast_pretty/src/pp.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/compiler/rustc_ast_pretty/src/pp.rs b/compiler/rustc_ast_pretty/src/pp.rs
index 43a3c792d4a..96d446e3638 100644
--- a/compiler/rustc_ast_pretty/src/pp.rs
+++ b/compiler/rustc_ast_pretty/src/pp.rs
@@ -347,10 +347,6 @@ impl Printer {
         }
     }
 
-    fn scan_pop(&mut self) -> usize {
-        self.scan_stack.pop_front().unwrap()
-    }
-
     fn scan_top(&self) -> usize {
         *self.scan_stack.front().unwrap()
     }
@@ -396,19 +392,19 @@ impl Printer {
             match self.buf[x].token {
                 Token::Begin(_) => {
                     if k > 0 {
-                        self.scan_pop();
+                        self.scan_stack.pop_front().unwrap();
                         self.buf[x].size += self.right_total;
                         self.check_stack(k - 1);
                     }
                 }
                 Token::End => {
                     // paper says + not =, but that makes no sense.
-                    self.scan_pop();
+                    self.scan_stack.pop_front().unwrap();
                     self.buf[x].size = 1;
                     self.check_stack(k + 1);
                 }
                 _ => {
-                    self.scan_pop();
+                    self.scan_stack.pop_front().unwrap();
                     self.buf[x].size += self.right_total;
                     if k > 0 {
                         self.check_stack(k);