mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Inline print_newline function
This commit is contained in:
parent
224536f4fe
commit
51eeb82d9d
@ -364,11 +364,6 @@ impl Printer {
|
||||
}
|
||||
}
|
||||
|
||||
fn print_newline(&mut self, amount: isize) {
|
||||
self.out.push('\n');
|
||||
self.pending_indentation = amount;
|
||||
}
|
||||
|
||||
fn get_top(&self) -> PrintFrame {
|
||||
*self
|
||||
.print_stack
|
||||
@ -396,12 +391,14 @@ impl Printer {
|
||||
self.space -= token.blank_space;
|
||||
}
|
||||
PrintFrame::Broken { offset, breaks: Breaks::Consistent } => {
|
||||
self.print_newline(offset + token.offset);
|
||||
self.out.push('\n');
|
||||
self.pending_indentation = offset + token.offset;
|
||||
self.space = self.margin - (offset + token.offset);
|
||||
}
|
||||
PrintFrame::Broken { offset, breaks: Breaks::Inconsistent } => {
|
||||
if size > self.space {
|
||||
self.print_newline(offset + token.offset);
|
||||
self.out.push('\n');
|
||||
self.pending_indentation = offset + token.offset;
|
||||
self.space = self.margin - (offset + token.offset);
|
||||
} else {
|
||||
self.pending_indentation += token.blank_space;
|
||||
|
Loading…
Reference in New Issue
Block a user