2017-02-07 20:05:30 +00:00
|
|
|
error: length comparison to zero
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/len_zero.rs:88:8
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | if x.len() == 0 {
|
|
|
|
| ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `x.is_empty()`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::len-zero` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::len_zero)]`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: length comparison to zero
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/len_zero.rs:92:8
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | if "".len() == 0 {}
|
|
|
|
| ^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `"".is_empty()`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2022-12-17 13:12:54 +00:00
|
|
|
error: comparison to empty slice
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/len_zero.rs:101:20
|
2022-12-17 13:12:54 +00:00
|
|
|
|
|
|
|
|
LL | println!("{}", *s1 == "");
|
|
|
|
| ^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s1.is_empty()`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::comparison-to-empty` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::comparison_to_empty)]`
|
2022-12-17 13:12:54 +00:00
|
|
|
|
|
|
|
error: comparison to empty slice
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/len_zero.rs:102:20
|
2022-12-17 13:12:54 +00:00
|
|
|
|
|
|
|
|
LL | println!("{}", **s2 == "");
|
|
|
|
| ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s2.is_empty()`
|
|
|
|
|
|
|
|
error: comparison to empty slice
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/len_zero.rs:103:20
|
2022-12-17 13:12:54 +00:00
|
|
|
|
|
|
|
|
LL | println!("{}", ***s3 == "");
|
|
|
|
| ^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s3.is_empty()`
|
|
|
|
|
|
|
|
error: comparison to empty slice
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/len_zero.rs:104:20
|
2022-12-17 13:12:54 +00:00
|
|
|
|
|
|
|
|
LL | println!("{}", ****s4 == "");
|
|
|
|
| ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s4.is_empty()`
|
|
|
|
|
|
|
|
error: comparison to empty slice
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/len_zero.rs:105:20
|
2022-12-17 13:12:54 +00:00
|
|
|
|
|
|
|
|
LL | println!("{}", *****s5 == "");
|
|
|
|
| ^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s5.is_empty()`
|
|
|
|
|
|
|
|
error: comparison to empty slice
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/len_zero.rs:106:20
|
2022-12-17 13:12:54 +00:00
|
|
|
|
|
|
|
|
LL | println!("{}", ******(s6) == "");
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `(s6).is_empty()`
|
|
|
|
|
|
|
|
error: comparison to empty slice
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/len_zero.rs:109:20
|
2022-12-17 13:12:54 +00:00
|
|
|
|
|
|
|
|
LL | println!("{}", &**d2s == "");
|
|
|
|
| ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `(**d2s).is_empty()`
|
|
|
|
|
2017-02-07 20:05:30 +00:00
|
|
|
error: length comparison to zero
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/len_zero.rs:124:8
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | if has_is_empty.len() == 0 {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: length comparison to zero
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/len_zero.rs:127:8
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | if has_is_empty.len() != 0 {
|
2019-08-01 13:20:08 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: length comparison to zero
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/len_zero.rs:130:8
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | if has_is_empty.len() > 0 {
|
2019-08-01 13:20:08 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2018-05-05 13:01:51 +00:00
|
|
|
error: length comparison to one
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/len_zero.rs:133:8
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | if has_is_empty.len() < 1 {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
|
2018-05-05 13:01:51 +00:00
|
|
|
|
|
|
|
error: length comparison to one
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/len_zero.rs:136:8
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | if has_is_empty.len() >= 1 {
|
2019-08-01 13:20:08 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
|
2018-05-05 13:01:51 +00:00
|
|
|
|
|
|
|
error: length comparison to zero
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/len_zero.rs:147:8
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | if 0 == has_is_empty.len() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
|
2018-05-05 13:01:51 +00:00
|
|
|
|
|
|
|
error: length comparison to zero
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/len_zero.rs:150:8
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | if 0 != has_is_empty.len() {
|
2019-08-01 13:20:08 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
|
2018-05-05 13:01:51 +00:00
|
|
|
|
|
|
|
error: length comparison to zero
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/len_zero.rs:153:8
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | if 0 < has_is_empty.len() {
|
2019-08-01 13:20:08 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
|
2018-05-05 13:01:51 +00:00
|
|
|
|
|
|
|
error: length comparison to one
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/len_zero.rs:156:8
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | if 1 <= has_is_empty.len() {
|
2019-08-01 13:20:08 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
|
2018-05-05 13:01:51 +00:00
|
|
|
|
|
|
|
error: length comparison to one
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/len_zero.rs:159:8
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | if 1 > has_is_empty.len() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
|
2018-05-05 13:01:51 +00:00
|
|
|
|
|
|
|
error: length comparison to zero
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/len_zero.rs:173:8
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | if with_is_empty.len() == 0 {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `with_is_empty.is_empty()`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2017-02-25 03:26:33 +00:00
|
|
|
error: length comparison to zero
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/len_zero.rs:185:6
|
2023-04-23 11:03:09 +00:00
|
|
|
|
|
|
|
|
LL | (has_is_empty.len() > 0).then(|| println!("This can happen."));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
|
|
|
|
|
|
|
|
error: length comparison to zero
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/len_zero.rs:186:6
|
2023-04-23 11:03:09 +00:00
|
|
|
|
|
|
|
|
LL | (has_is_empty.len() == 0).then(|| println!("Or this!"));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
|
|
|
|
|
|
|
|
error: length comparison to zero
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/len_zero.rs:190:8
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | if b.len() != 0 {}
|
2019-08-01 13:20:08 +00:00
|
|
|
| ^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!b.is_empty()`
|
2017-02-25 03:26:33 +00:00
|
|
|
|
2023-04-23 11:03:09 +00:00
|
|
|
error: aborting due to 23 previous errors
|
2018-01-16 16:06:27 +00:00
|
|
|
|