File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
compiler/rustc_ast_pretty/src Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -366,12 +366,7 @@ impl Printer {
366366
367367 fn print_newline ( & mut self , amount : isize ) {
368368 self . out . push ( '\n' ) ;
369- self . pending_indentation = 0 ;
370- self . indent ( amount) ;
371- }
372-
373- fn indent ( & mut self , amount : isize ) {
374- self . pending_indentation += amount;
369+ self . pending_indentation = amount;
375370 }
376371
377372 fn get_top ( & self ) -> PrintFrame {
@@ -397,7 +392,7 @@ impl Printer {
397392 fn print_break ( & mut self , token : BreakToken , size : isize ) {
398393 match self . get_top ( ) {
399394 PrintFrame :: Fits => {
400- self . indent ( token. blank_space ) ;
395+ self . pending_indentation += token. blank_space ;
401396 self . space -= token. blank_space ;
402397 }
403398 PrintFrame :: Broken { offset, breaks : Breaks :: Consistent } => {
@@ -409,7 +404,7 @@ impl Printer {
409404 self . print_newline ( offset + token. offset ) ;
410405 self . space = self . margin - ( offset + token. offset ) ;
411406 } else {
412- self . indent ( token. blank_space ) ;
407+ self . pending_indentation += token. blank_space ;
413408 self . space -= token. blank_space ;
414409 }
415410 }
You can’t perform that action at this time.
0 commit comments