2020-11-05 07:29:48 -06:00
|
|
|
error: comparison to empty slice
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/comparison_to_empty.rs:8:13
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
LL | let _ = s == "";
|
|
|
|
| ^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.is_empty()`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::comparison-to-empty` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::comparison_to_empty)]`
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
error: comparison to empty slice
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/comparison_to_empty.rs:9:13
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
LL | let _ = s != "";
|
|
|
|
| ^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!s.is_empty()`
|
|
|
|
|
|
|
|
error: comparison to empty slice
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/comparison_to_empty.rs:12:13
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
LL | let _ = v == [];
|
|
|
|
| ^^^^^^^ help: using `is_empty` is clearer and more explicit: `v.is_empty()`
|
|
|
|
|
|
|
|
error: comparison to empty slice
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/comparison_to_empty.rs:13:13
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
LL | let _ = v != [];
|
|
|
|
| ^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!v.is_empty()`
|
|
|
|
|
2023-07-31 16:53:53 -05:00
|
|
|
error: comparison to empty slice using `if let`
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/comparison_to_empty.rs:14:8
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | if let [] = &*v {}
|
|
|
|
| ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `(*v).is_empty()`
|
|
|
|
|
|
|
|
error: comparison to empty slice using `if let`
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/comparison_to_empty.rs:16:8
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | if let [] = s {}
|
|
|
|
| ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.is_empty()`
|
|
|
|
|
|
|
|
error: comparison to empty slice using `if let`
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/comparison_to_empty.rs:17:8
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | if let [] = &*s {}
|
|
|
|
| ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.is_empty()`
|
|
|
|
|
|
|
|
error: comparison to empty slice using `if let`
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/comparison_to_empty.rs:18:8
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
2023-11-02 11:12:25 -05:00
|
|
|
LL | if let [] = &*s
|
2023-07-31 16:53:53 -05:00
|
|
|
| ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.is_empty()`
|
|
|
|
|
|
|
|
error: comparison to empty slice
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/comparison_to_empty.rs:19:12
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
2023-11-02 11:12:25 -05:00
|
|
|
LL | && s == []
|
|
|
|
| ^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.is_empty()`
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
error: aborting due to 9 previous errors
|
2020-11-05 07:29:48 -06:00
|
|
|
|