File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed
compiler/rustc_ast_pretty/src Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -311,13 +311,12 @@ impl Printer {
311311 self . left_total = 1 ;
312312 self . right_total = 1 ;
313313 self . right = self . left ;
314- self . buf . truncate ( 1 ) ;
314+ self . buf . clear ( ) ;
315315 } else {
316- self . right += 1 ;
317- self . buf . advance_right ( ) ;
318316 self . check_stack ( 0 ) ;
317+ self . right += 1 ;
319318 }
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 } ) ;
321320 self . scan_stack . push_front ( self . right ) ;
322321 self . right_total += b. blank_space ;
323322 }
Original file line number Diff line number Diff line change @@ -41,10 +41,6 @@ impl<T> RingBuffer<T> {
4141 pub fn clear ( & mut self ) {
4242 self . data . clear ( ) ;
4343 }
44-
45- pub fn truncate ( & mut self , len : usize ) {
46- self . data . truncate ( len) ;
47- }
4844}
4945
5046impl < T > Index < usize > for RingBuffer < T > {
You can’t perform that action at this time.
0 commit comments