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> {
95
95
let snippet = self . snippet ( span) ;
96
96
97
97
// 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 ( ) {
99
101
return ;
100
102
}
101
103
102
104
if snippet. trim ( ) . is_empty ( ) && !out_of_file_lines_range ! ( self , span) {
103
- if self . is_start_span ( span) {
104
- return ;
105
- }
106
-
107
105
// Keep vertical spaces within range.
108
106
self . push_vertical_spaces ( count_newlines ( snippet) ) ;
109
107
process_last_snippet ( self , "" , snippet) ;
You can’t perform that action at this time.
0 commit comments