about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_ast_pretty/src/pp.rs19
1 files changed, 8 insertions, 11 deletions
diff --git a/compiler/rustc_ast_pretty/src/pp.rs b/compiler/rustc_ast_pretty/src/pp.rs
index 2c7962e44d0..1a6a7f2c52a 100644
--- a/compiler/rustc_ast_pretty/src/pp.rs
+++ b/compiler/rustc_ast_pretty/src/pp.rs
@@ -325,7 +325,14 @@ impl Printer {
                 _ => {}
             }
 
-            self.print(left.token, left.size);
+            match &left.token {
+                Token::Begin(b) => self.print_begin(*b, left.size),
+                Token::End => self.print_end(),
+                Token::Break(b) => self.print_break(*b, left.size),
+                Token::String(s) => self.print_string(s),
+            }
+
+            self.last_printed = Some(left.token);
 
             if self.buf.is_empty() {
                 break;
@@ -432,16 +439,6 @@ impl Printer {
         self.out.push_str(s);
     }
 
-    fn print(&mut self, token: Token, l: isize) {
-        match &token {
-            Token::Begin(b) => self.print_begin(*b, l),
-            Token::End => self.print_end(),
-            Token::Break(b) => self.print_break(*b, l),
-            Token::String(s) => self.print_string(s),
-        }
-        self.last_printed = Some(token);
-    }
-
     // Convenience functions to talk to the printer.
 
     /// "raw box"