File tree 1 file changed +3
-8
lines changed
compiler/rustc_ast_pretty/src
1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -366,12 +366,7 @@ impl Printer {
366
366
367
367
fn print_newline ( & mut self , amount : isize ) {
368
368
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;
375
370
}
376
371
377
372
fn get_top ( & self ) -> PrintFrame {
@@ -397,7 +392,7 @@ impl Printer {
397
392
fn print_break ( & mut self , token : BreakToken , size : isize ) {
398
393
match self . get_top ( ) {
399
394
PrintFrame :: Fits => {
400
- self . indent ( token. blank_space ) ;
395
+ self . pending_indentation += token. blank_space ;
401
396
self . space -= token. blank_space ;
402
397
}
403
398
PrintFrame :: Broken { offset, breaks : Breaks :: Consistent } => {
@@ -409,7 +404,7 @@ impl Printer {
409
404
self . print_newline ( offset + token. offset ) ;
410
405
self . space = self . margin - ( offset + token. offset ) ;
411
406
} else {
412
- self . indent ( token. blank_space ) ;
407
+ self . pending_indentation += token. blank_space ;
413
408
self . space -= token. blank_space ;
414
409
}
415
410
}
You can’t perform that action at this time.
0 commit comments