Skip to content

Commit ae75ba6

Browse files
committed
Inline print into advance_left
1 parent d2eb46c commit ae75ba6

File tree

1 file changed

+8
-11
lines changed
  • compiler/rustc_ast_pretty/src

1 file changed

+8
-11
lines changed

compiler/rustc_ast_pretty/src/pp.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,14 @@ impl Printer {
325325
_ => {}
326326
}
327327

328-
self.print(left.token, left.size);
328+
match &left.token {
329+
Token::Begin(b) => self.print_begin(*b, left.size),
330+
Token::End => self.print_end(),
331+
Token::Break(b) => self.print_break(*b, left.size),
332+
Token::String(s) => self.print_string(s),
333+
}
334+
335+
self.last_printed = Some(left.token);
329336

330337
if self.buf.is_empty() {
331338
break;
@@ -432,16 +439,6 @@ impl Printer {
432439
self.out.push_str(s);
433440
}
434441

435-
fn print(&mut self, token: Token, l: isize) {
436-
match &token {
437-
Token::Begin(b) => self.print_begin(*b, l),
438-
Token::End => self.print_end(),
439-
Token::Break(b) => self.print_break(*b, l),
440-
Token::String(s) => self.print_string(s),
441-
}
442-
self.last_printed = Some(token);
443-
}
444-
445442
// Convenience functions to talk to the printer.
446443

447444
/// "raw box"

0 commit comments

Comments
 (0)