@@ -445,13 +445,8 @@ pub trait PrintState<'a> {
445445
446446 fn pclose ( & mut self ) { self . writer ( ) . word ( ")" ) }
447447
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-
453448 fn hardbreak_if_not_bol ( & mut self ) {
454- if !self . is_bol ( ) {
449+ if !self . writer ( ) . is_beginning_of_line ( ) {
455450 self . writer ( ) . hardbreak ( )
456451 }
457452 }
@@ -512,7 +507,7 @@ pub trait PrintState<'a> {
512507 }
513508 }
514509 comments:: Trailing => {
515- if !self . is_bol ( ) {
510+ if !self . writer ( ) . is_beginning_of_line ( ) {
516511 self . writer ( ) . word ( " " ) ;
517512 }
518513 if cmnt. lines . len ( ) == 1 {
@@ -735,7 +730,7 @@ pub trait PrintState<'a> {
735730 }
736731
737732 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 ( ) ; }
739734 }
740735
741736 fn nbsp ( & mut self ) { self . writer ( ) . word ( " " ) }
@@ -793,7 +788,7 @@ impl<'a> State<'a> {
793788
794789 crate fn break_offset_if_not_bol ( & mut self , n : usize ,
795790 off : isize ) {
796- if !self . is_bol ( ) {
791+ if !self . s . is_beginning_of_line ( ) {
797792 self . s . break_offset ( n, off)
798793 } else {
799794 if off != 0 && self . s . last_token ( ) . is_hardbreak_tok ( ) {
0 commit comments