File tree 2 files changed +3
-8
lines changed
compiler/rustc_ast_pretty/src
2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -311,13 +311,12 @@ impl Printer {
311
311
self . left_total = 1 ;
312
312
self . right_total = 1 ;
313
313
self . right = self . left ;
314
- self . buf . truncate ( 1 ) ;
314
+ self . buf . clear ( ) ;
315
315
} else {
316
- self . right += 1 ;
317
- self . buf . advance_right ( ) ;
318
316
self . check_stack ( 0 ) ;
317
+ self . right += 1 ;
319
318
}
320
- self . buf [ self . right ] = BufEntry { token : Token :: Break ( b) , size : -self . right_total } ;
319
+ self . buf . push ( BufEntry { token : Token :: Break ( b) , size : -self . right_total } ) ;
321
320
self . scan_stack . push_front ( self . right ) ;
322
321
self . right_total += b. blank_space ;
323
322
}
Original file line number Diff line number Diff line change @@ -41,10 +41,6 @@ impl<T> RingBuffer<T> {
41
41
pub fn clear ( & mut self ) {
42
42
self . data . clear ( ) ;
43
43
}
44
-
45
- pub fn truncate ( & mut self , len : usize ) {
46
- self . data . truncate ( len) ;
47
- }
48
44
}
49
45
50
46
impl < T > Index < usize > for RingBuffer < T > {
You can’t perform that action at this time.
0 commit comments