Skip to content

Commit 51eeb82

Browse files
committed
Inline print_newline function
1 parent 224536f commit 51eeb82

File tree

1 file changed

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

1 file changed

+4
-7
lines changed

compiler/rustc_ast_pretty/src/pp.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -364,11 +364,6 @@ impl Printer {
364364
}
365365
}
366366

367-
fn print_newline(&mut self, amount: isize) {
368-
self.out.push('\n');
369-
self.pending_indentation = amount;
370-
}
371-
372367
fn get_top(&self) -> PrintFrame {
373368
*self
374369
.print_stack
@@ -396,12 +391,14 @@ impl Printer {
396391
self.space -= token.blank_space;
397392
}
398393
PrintFrame::Broken { offset, breaks: Breaks::Consistent } => {
399-
self.print_newline(offset + token.offset);
394+
self.out.push('\n');
395+
self.pending_indentation = offset + token.offset;
400396
self.space = self.margin - (offset + token.offset);
401397
}
402398
PrintFrame::Broken { offset, breaks: Breaks::Inconsistent } => {
403399
if size > self.space {
404-
self.print_newline(offset + token.offset);
400+
self.out.push('\n');
401+
self.pending_indentation = offset + token.offset;
405402
self.space = self.margin - (offset + token.offset);
406403
} else {
407404
self.pending_indentation += token.blank_space;

0 commit comments

Comments
 (0)