@@ -58,107 +58,113 @@ error: comparison to empty slice
58
58
LL | println!("{}", &**d2s == "");
59
59
| ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `(**d2s).is_empty()`
60
60
61
+ error: comparison to empty slice
62
+ --> tests/ui/len_zero.rs:111:20
63
+ |
64
+ LL | println!("{}", std::borrow::Cow::Borrowed("") == "");
65
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `std::borrow::Cow::Borrowed("").is_empty()`
66
+
61
67
error: length comparison to zero
62
- --> tests/ui/len_zero.rs:124 :8
68
+ --> tests/ui/len_zero.rs:126 :8
63
69
|
64
70
LL | if has_is_empty.len() == 0 {
65
71
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
66
72
67
73
error: length comparison to zero
68
- --> tests/ui/len_zero.rs:127 :8
74
+ --> tests/ui/len_zero.rs:129 :8
69
75
|
70
76
LL | if has_is_empty.len() != 0 {
71
77
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
72
78
73
79
error: length comparison to zero
74
- --> tests/ui/len_zero.rs:130 :8
80
+ --> tests/ui/len_zero.rs:132 :8
75
81
|
76
82
LL | if has_is_empty.len() > 0 {
77
83
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
78
84
79
85
error: length comparison to one
80
- --> tests/ui/len_zero.rs:133 :8
86
+ --> tests/ui/len_zero.rs:135 :8
81
87
|
82
88
LL | if has_is_empty.len() < 1 {
83
89
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
84
90
85
91
error: length comparison to one
86
- --> tests/ui/len_zero.rs:136 :8
92
+ --> tests/ui/len_zero.rs:138 :8
87
93
|
88
94
LL | if has_is_empty.len() >= 1 {
89
95
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
90
96
91
97
error: length comparison to zero
92
- --> tests/ui/len_zero.rs:147 :8
98
+ --> tests/ui/len_zero.rs:149 :8
93
99
|
94
100
LL | if 0 == has_is_empty.len() {
95
101
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
96
102
97
103
error: length comparison to zero
98
- --> tests/ui/len_zero.rs:150 :8
104
+ --> tests/ui/len_zero.rs:152 :8
99
105
|
100
106
LL | if 0 != has_is_empty.len() {
101
107
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
102
108
103
109
error: length comparison to zero
104
- --> tests/ui/len_zero.rs:153 :8
110
+ --> tests/ui/len_zero.rs:155 :8
105
111
|
106
112
LL | if 0 < has_is_empty.len() {
107
113
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
108
114
109
115
error: length comparison to one
110
- --> tests/ui/len_zero.rs:156 :8
116
+ --> tests/ui/len_zero.rs:158 :8
111
117
|
112
118
LL | if 1 <= has_is_empty.len() {
113
119
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
114
120
115
121
error: length comparison to one
116
- --> tests/ui/len_zero.rs:159 :8
122
+ --> tests/ui/len_zero.rs:161 :8
117
123
|
118
124
LL | if 1 > has_is_empty.len() {
119
125
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
120
126
121
127
error: length comparison to zero
122
- --> tests/ui/len_zero.rs:173 :8
128
+ --> tests/ui/len_zero.rs:175 :8
123
129
|
124
130
LL | if with_is_empty.len() == 0 {
125
131
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `with_is_empty.is_empty()`
126
132
127
133
error: length comparison to zero
128
- --> tests/ui/len_zero.rs:185 :6
134
+ --> tests/ui/len_zero.rs:187 :6
129
135
|
130
136
LL | (has_is_empty.len() > 0).then(|| println!("This can happen."));
131
137
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
132
138
133
139
error: length comparison to zero
134
- --> tests/ui/len_zero.rs:186 :6
140
+ --> tests/ui/len_zero.rs:188 :6
135
141
|
136
142
LL | (has_is_empty.len() == 0).then(|| println!("Or this!"));
137
143
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
138
144
139
145
error: length comparison to zero
140
- --> tests/ui/len_zero.rs:190 :8
146
+ --> tests/ui/len_zero.rs:192 :8
141
147
|
142
148
LL | if b.len() != 0 {}
143
149
| ^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!b.is_empty()`
144
150
145
151
error: length comparison to zero
146
- --> tests/ui/len_zero.rs:224 :8
152
+ --> tests/ui/len_zero.rs:226 :8
147
153
|
148
154
LL | if has_is_empty.len() == compare_to!(0) {}
149
155
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
150
156
151
157
error: length comparison to zero
152
- --> tests/ui/len_zero.rs:225 :8
158
+ --> tests/ui/len_zero.rs:227 :8
153
159
|
154
160
LL | if has_is_empty.len() == zero!() {}
155
161
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
156
162
157
163
error: length comparison to zero
158
- --> tests/ui/len_zero.rs:227 :6
164
+ --> tests/ui/len_zero.rs:229 :6
159
165
|
160
166
LL | (compare_to!(0) < has_is_empty.len()).then(|| println!("This can happen."));
161
167
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
162
168
163
- error: aborting due to 26 previous errors
169
+ error: aborting due to 27 previous errors
164
170
0 commit comments