@@ -445,13 +445,8 @@ pub trait PrintState<'a> {
445
445
446
446
fn pclose ( & mut self ) { self . writer ( ) . word ( ")" ) }
447
447
448
- // is this the beginning of a line?
449
- fn is_bol ( & mut self ) -> bool {
450
- self . writer ( ) . last_token ( ) . is_eof ( ) || self . writer ( ) . last_token ( ) . is_hardbreak_tok ( )
451
- }
452
-
453
448
fn hardbreak_if_not_bol ( & mut self ) {
454
- if !self . is_bol ( ) {
449
+ if !self . writer ( ) . is_beginning_of_line ( ) {
455
450
self . writer ( ) . hardbreak ( )
456
451
}
457
452
}
@@ -512,7 +507,7 @@ pub trait PrintState<'a> {
512
507
}
513
508
}
514
509
comments:: Trailing => {
515
- if !self . is_bol ( ) {
510
+ if !self . writer ( ) . is_beginning_of_line ( ) {
516
511
self . writer ( ) . word ( " " ) ;
517
512
}
518
513
if cmnt. lines . len ( ) == 1 {
@@ -735,7 +730,7 @@ pub trait PrintState<'a> {
735
730
}
736
731
737
732
fn space_if_not_bol ( & mut self ) {
738
- if !self . is_bol ( ) { self . writer ( ) . space ( ) ; }
733
+ if !self . writer ( ) . is_beginning_of_line ( ) { self . writer ( ) . space ( ) ; }
739
734
}
740
735
741
736
fn nbsp ( & mut self ) { self . writer ( ) . word ( " " ) }
@@ -793,7 +788,7 @@ impl<'a> State<'a> {
793
788
794
789
crate fn break_offset_if_not_bol ( & mut self , n : usize ,
795
790
off : isize ) {
796
- if !self . is_bol ( ) {
791
+ if !self . s . is_beginning_of_line ( ) {
797
792
self . s . break_offset ( n, off)
798
793
} else {
799
794
if off != 0 && self . s . last_token ( ) . is_hardbreak_tok ( ) {
0 commit comments