@@ -222,13 +222,13 @@ fn buf_str(buf: &[BufEntry], left: usize, right: usize, lim: usize) -> String {
222222}
223223
224224#[ derive( Copy , Clone ) ]
225- crate enum PrintStackBreak {
225+ enum PrintStackBreak {
226226 Fits ,
227227 Broken ( Breaks ) ,
228228}
229229
230230#[ derive( Copy , Clone ) ]
231- crate struct PrintStackElem {
231+ struct PrintStackElem {
232232 offset : isize ,
233233 pbreak : PrintStackBreak
234234}
@@ -380,7 +380,7 @@ impl Printer {
380380 }
381381 }
382382
383- crate fn check_stream ( & mut self ) {
383+ fn check_stream ( & mut self ) {
384384 debug ! ( "check_stream Vec<{}, {}> with left_total={}, right_total={}" ,
385385 self . left, self . right, self . left_total, self . right_total) ;
386386 if self . right_total - self . left_total > self . space {
@@ -398,24 +398,24 @@ impl Printer {
398398 }
399399 }
400400
401- crate fn scan_push ( & mut self , x : usize ) {
401+ fn scan_push ( & mut self , x : usize ) {
402402 debug ! ( "scan_push {}" , x) ;
403403 self . scan_stack . push_front ( x) ;
404404 }
405405
406- crate fn scan_pop ( & mut self ) -> usize {
406+ fn scan_pop ( & mut self ) -> usize {
407407 self . scan_stack . pop_front ( ) . unwrap ( )
408408 }
409409
410- crate fn scan_top ( & mut self ) -> usize {
410+ fn scan_top ( & mut self ) -> usize {
411411 * self . scan_stack . front ( ) . unwrap ( )
412412 }
413413
414- crate fn scan_pop_bottom ( & mut self ) -> usize {
414+ fn scan_pop_bottom ( & mut self ) -> usize {
415415 self . scan_stack . pop_back ( ) . unwrap ( )
416416 }
417417
418- crate fn advance_right ( & mut self ) {
418+ fn advance_right ( & mut self ) {
419419 self . right += 1 ;
420420 self . right %= self . buf_max_len ;
421421 // Extend the buf if necessary.
@@ -425,7 +425,7 @@ impl Printer {
425425 assert_ne ! ( self . right, self . left) ;
426426 }
427427
428- crate fn advance_left ( & mut self ) {
428+ fn advance_left ( & mut self ) {
429429 debug ! ( "advance_left Vec<{},{}>, sizeof({})={}" , self . left, self . right,
430430 self . left, self . buf[ self . left] . size) ;
431431
@@ -458,7 +458,7 @@ impl Printer {
458458 }
459459 }
460460
461- crate fn check_stack ( & mut self , k : isize ) {
461+ fn check_stack ( & mut self , k : isize ) {
462462 if !self . scan_stack . is_empty ( ) {
463463 let x = self . scan_top ( ) ;
464464 match self . buf [ x] . token {
@@ -486,19 +486,19 @@ impl Printer {
486486 }
487487 }
488488
489- crate fn print_newline ( & mut self , amount : isize ) {
489+ fn print_newline ( & mut self , amount : isize ) {
490490 debug ! ( "NEWLINE {}" , amount) ;
491491 self . out . push ( '\n' ) ;
492492 self . pending_indentation = 0 ;
493493 self . indent ( amount) ;
494494 }
495495
496- crate fn indent ( & mut self , amount : isize ) {
496+ fn indent ( & mut self , amount : isize ) {
497497 debug ! ( "INDENT {}" , amount) ;
498498 self . pending_indentation += amount;
499499 }
500500
501- crate fn get_top ( & mut self ) -> PrintStackElem {
501+ fn get_top ( & mut self ) -> PrintStackElem {
502502 match self . print_stack . last ( ) {
503503 Some ( el) => * el,
504504 None => PrintStackElem {
@@ -508,7 +508,7 @@ impl Printer {
508508 }
509509 }
510510
511- crate fn print_begin ( & mut self , b : BeginToken , l : isize ) {
511+ fn print_begin ( & mut self , b : BeginToken , l : isize ) {
512512 if l > self . space {
513513 let col = self . margin - self . space + b. offset ;
514514 debug ! ( "print Begin -> push broken block at col {}" , col) ;
@@ -525,14 +525,14 @@ impl Printer {
525525 }
526526 }
527527
528- crate fn print_end ( & mut self ) {
528+ fn print_end ( & mut self ) {
529529 debug ! ( "print End -> pop End" ) ;
530530 let print_stack = & mut self . print_stack ;
531531 assert ! ( !print_stack. is_empty( ) ) ;
532532 print_stack. pop ( ) . unwrap ( ) ;
533533 }
534534
535- crate fn print_break ( & mut self , b : BreakToken , l : isize ) {
535+ fn print_break ( & mut self , b : BreakToken , l : isize ) {
536536 let top = self . get_top ( ) ;
537537 match top. pbreak {
538538 PrintStackBreak :: Fits => {
@@ -562,7 +562,7 @@ impl Printer {
562562 }
563563 }
564564
565- crate fn print_string ( & mut self , s : Cow < ' static , str > , len : isize ) {
565+ fn print_string ( & mut self , s : Cow < ' static , str > , len : isize ) {
566566 debug ! ( "print String({})" , s) ;
567567 // assert!(len <= space);
568568 self . space -= len;
@@ -579,7 +579,7 @@ impl Printer {
579579 self . out . push_str ( & s) ;
580580 }
581581
582- crate fn print ( & mut self , token : Token , l : isize ) {
582+ fn print ( & mut self , token : Token , l : isize ) {
583583 debug ! ( "print {} {} (remaining line space={})" , token, l,
584584 self . space) ;
585585 debug ! ( "{}" , buf_str( & self . buf,
0 commit comments