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 @@ -88,11 +88,9 @@ impl<'a> FmtVisitor<'a> {
88
88
89
89
fn push_vertical_spaces ( & mut self , mut newline_count : usize ) {
90
90
// The buffer already has a trailing newline.
91
- if self . buffer . cur_offset ( ) == 0 {
92
- newline_count = newline_count. checked_sub ( 1 ) . unwrap_or ( 0 ) ;
93
- }
94
- let newline_upper_bound = self . config . blank_lines_upper_bound ( ) + 1 ;
95
- let newline_lower_bound = self . config . blank_lines_lower_bound ( ) + 1 ;
91
+ let offset = if self . buffer . cur_offset ( ) == 0 { 0 } else { 1 } ;
92
+ let newline_upper_bound = self . config . blank_lines_upper_bound ( ) + offset;
93
+ let newline_lower_bound = self . config . blank_lines_lower_bound ( ) + offset;
96
94
if newline_count > newline_upper_bound {
97
95
newline_count = newline_upper_bound;
98
96
} else if newline_count < newline_lower_bound {
You can’t perform that action at this time.
0 commit comments