@@ -42,7 +42,6 @@ fn find_line_comment(
42
42
lines : impl IntoIterator < Item = usize > ,
43
43
) -> ( bool , Vec < usize > , usize , usize ) {
44
44
let mut commented = true ;
45
- let mut text_is_empty = true ;
46
45
let mut to_change = Vec :: new ( ) ;
47
46
let mut min = usize:: MAX ; // minimum col for first_non_whitespace_char
48
47
let mut margin = 1 ;
@@ -51,7 +50,6 @@ fn find_line_comment(
51
50
for line in lines {
52
51
let line_slice = text. line ( line) ;
53
52
if let Some ( pos) = line_slice. first_non_whitespace_char ( ) {
54
- text_is_empty = false ;
55
53
let len = line_slice. len_chars ( ) ;
56
54
57
55
min = std:: cmp:: min ( min, pos) ;
@@ -76,10 +74,6 @@ fn find_line_comment(
76
74
}
77
75
}
78
76
79
- if text_is_empty {
80
- commented = false ;
81
- }
82
-
83
77
( commented, to_change, min, margin)
84
78
}
85
79
@@ -344,14 +338,6 @@ mod test {
344
338
mod find_line_comment {
345
339
use super :: * ;
346
340
347
- #[ test]
348
- fn empty_line ( ) {
349
- let doc = Rope :: from ( "" ) ;
350
-
351
- let ( is_commented, _, _, _) = find_line_comment ( "//" , doc. slice ( ..) , [ 0 ] ) ;
352
- assert ! ( !is_commented) ;
353
- }
354
-
355
341
#[ test]
356
342
fn not_commented ( ) {
357
343
// four lines, two space indented, except for line 1 which is blank.
0 commit comments