1
1
error: length comparison to zero
2
- --> tests/ui/len_zero.rs:82 :8
2
+ --> tests/ui/len_zero.rs:88 :8
3
3
|
4
4
LL | if x.len() == 0 {
5
5
| ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `x.is_empty()`
@@ -8,13 +8,13 @@ LL | if x.len() == 0 {
8
8
= help: to override `-D warnings` add `#[allow(clippy::len_zero)]`
9
9
10
10
error: length comparison to zero
11
- --> tests/ui/len_zero.rs:86 :8
11
+ --> tests/ui/len_zero.rs:92 :8
12
12
|
13
13
LL | if "".len() == 0 {}
14
14
| ^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `"".is_empty()`
15
15
16
16
error: comparison to empty slice
17
- --> tests/ui/len_zero.rs:95 :20
17
+ --> tests/ui/len_zero.rs:101 :20
18
18
|
19
19
LL | println!("{}", *s1 == "");
20
20
| ^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s1.is_empty()`
@@ -23,121 +23,121 @@ LL | println!("{}", *s1 == "");
23
23
= help: to override `-D warnings` add `#[allow(clippy::comparison_to_empty)]`
24
24
25
25
error: comparison to empty slice
26
- --> tests/ui/len_zero.rs:96 :20
26
+ --> tests/ui/len_zero.rs:102 :20
27
27
|
28
28
LL | println!("{}", **s2 == "");
29
29
| ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s2.is_empty()`
30
30
31
31
error: comparison to empty slice
32
- --> tests/ui/len_zero.rs:97 :20
32
+ --> tests/ui/len_zero.rs:103 :20
33
33
|
34
34
LL | println!("{}", ***s3 == "");
35
35
| ^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s3.is_empty()`
36
36
37
37
error: comparison to empty slice
38
- --> tests/ui/len_zero.rs:98 :20
38
+ --> tests/ui/len_zero.rs:104 :20
39
39
|
40
40
LL | println!("{}", ****s4 == "");
41
41
| ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s4.is_empty()`
42
42
43
43
error: comparison to empty slice
44
- --> tests/ui/len_zero.rs:99 :20
44
+ --> tests/ui/len_zero.rs:105 :20
45
45
|
46
46
LL | println!("{}", *****s5 == "");
47
47
| ^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s5.is_empty()`
48
48
49
49
error: comparison to empty slice
50
- --> tests/ui/len_zero.rs:100 :20
50
+ --> tests/ui/len_zero.rs:106 :20
51
51
|
52
52
LL | println!("{}", ******(s6) == "");
53
53
| ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `(s6).is_empty()`
54
54
55
55
error: comparison to empty slice
56
- --> tests/ui/len_zero.rs:103 :20
56
+ --> tests/ui/len_zero.rs:109 :20
57
57
|
58
58
LL | println!("{}", &**d2s == "");
59
59
| ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `(**d2s).is_empty()`
60
60
61
61
error: length comparison to zero
62
- --> tests/ui/len_zero.rs:118 :8
62
+ --> tests/ui/len_zero.rs:124 :8
63
63
|
64
64
LL | if has_is_empty.len() == 0 {
65
65
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
66
66
67
67
error: length comparison to zero
68
- --> tests/ui/len_zero.rs:121 :8
68
+ --> tests/ui/len_zero.rs:127 :8
69
69
|
70
70
LL | if has_is_empty.len() != 0 {
71
71
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
72
72
73
73
error: length comparison to zero
74
- --> tests/ui/len_zero.rs:124 :8
74
+ --> tests/ui/len_zero.rs:130 :8
75
75
|
76
76
LL | if has_is_empty.len() > 0 {
77
77
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
78
78
79
79
error: length comparison to one
80
- --> tests/ui/len_zero.rs:127 :8
80
+ --> tests/ui/len_zero.rs:133 :8
81
81
|
82
82
LL | if has_is_empty.len() < 1 {
83
83
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
84
84
85
85
error: length comparison to one
86
- --> tests/ui/len_zero.rs:130 :8
86
+ --> tests/ui/len_zero.rs:136 :8
87
87
|
88
88
LL | if has_is_empty.len() >= 1 {
89
89
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
90
90
91
91
error: length comparison to zero
92
- --> tests/ui/len_zero.rs:141 :8
92
+ --> tests/ui/len_zero.rs:147 :8
93
93
|
94
94
LL | if 0 == has_is_empty.len() {
95
95
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
96
96
97
97
error: length comparison to zero
98
- --> tests/ui/len_zero.rs:144 :8
98
+ --> tests/ui/len_zero.rs:150 :8
99
99
|
100
100
LL | if 0 != has_is_empty.len() {
101
101
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
102
102
103
103
error: length comparison to zero
104
- --> tests/ui/len_zero.rs:147 :8
104
+ --> tests/ui/len_zero.rs:153 :8
105
105
|
106
106
LL | if 0 < has_is_empty.len() {
107
107
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
108
108
109
109
error: length comparison to one
110
- --> tests/ui/len_zero.rs:150 :8
110
+ --> tests/ui/len_zero.rs:156 :8
111
111
|
112
112
LL | if 1 <= has_is_empty.len() {
113
113
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
114
114
115
115
error: length comparison to one
116
- --> tests/ui/len_zero.rs:153 :8
116
+ --> tests/ui/len_zero.rs:159 :8
117
117
|
118
118
LL | if 1 > has_is_empty.len() {
119
119
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
120
120
121
121
error: length comparison to zero
122
- --> tests/ui/len_zero.rs:167 :8
122
+ --> tests/ui/len_zero.rs:173 :8
123
123
|
124
124
LL | if with_is_empty.len() == 0 {
125
125
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `with_is_empty.is_empty()`
126
126
127
127
error: length comparison to zero
128
- --> tests/ui/len_zero.rs:179 :6
128
+ --> tests/ui/len_zero.rs:185 :6
129
129
|
130
130
LL | (has_is_empty.len() > 0).then(|| println!("This can happen."));
131
131
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
132
132
133
133
error: length comparison to zero
134
- --> tests/ui/len_zero.rs:180 :6
134
+ --> tests/ui/len_zero.rs:186 :6
135
135
|
136
136
LL | (has_is_empty.len() == 0).then(|| println!("Or this!"));
137
137
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
138
138
139
139
error: length comparison to zero
140
- --> tests/ui/len_zero.rs:184 :8
140
+ --> tests/ui/len_zero.rs:190 :8
141
141
|
142
142
LL | if b.len() != 0 {}
143
143
| ^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!b.is_empty()`
0 commit comments