File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -95,15 +95,13 @@ impl<'a> FmtVisitor<'a> {
9595 let snippet = self . snippet ( span) ;
9696
9797 // Do nothing for spaces in the beginning of the file
98- if start == BytePos ( 0 ) && end. 0 as usize == snippet. len ( ) && snippet. trim ( ) . is_empty ( ) {
98+ let is_start_span =
99+ ( start == BytePos ( 0 ) && end. 0 as usize == snippet. len ( ) ) || self . is_start_span ( span) ;
100+ if is_start_span && snippet. trim ( ) . is_empty ( ) {
99101 return ;
100102 }
101103
102104 if snippet. trim ( ) . is_empty ( ) && !out_of_file_lines_range ! ( self , span) {
103- if self . is_start_span ( span) {
104- return ;
105- }
106-
107105 // Keep vertical spaces within range.
108106 self . push_vertical_spaces ( count_newlines ( snippet) ) ;
109107 process_last_snippet ( self , "" , snippet) ;
You can’t perform that action at this time.
0 commit comments