rust-clippy/tests/ui/comparison_to_empty.stderr

84 lines
2.8 KiB
Text
Raw Normal View History

error: comparison to empty slice
2024-02-17 12:16:29 +00:00
--> tests/ui/comparison_to_empty.rs:8:13
|
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`
= help: to override `-D warnings` add `#[allow(clippy::comparison_to_empty)]`
error: comparison to empty slice
2024-02-17 12:16:29 +00:00
--> tests/ui/comparison_to_empty.rs:9:13
|
LL | let _ = s != "";
| ^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!s.is_empty()`
error: comparison to empty slice
2024-02-17 12:16:29 +00:00
--> tests/ui/comparison_to_empty.rs:12:13
|
LL | let _ = v == [];
| ^^^^^^^ help: using `is_empty` is clearer and more explicit: `v.is_empty()`
error: comparison to empty slice
2024-02-17 12:16:29 +00:00
--> tests/ui/comparison_to_empty.rs:13:13
|
LL | 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 12:16:29 +00:00
--> tests/ui/comparison_to_empty.rs:14:8
|
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 12:16:29 +00:00
--> tests/ui/comparison_to_empty.rs:16:8
|
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 12:16:29 +00:00
--> tests/ui/comparison_to_empty.rs:17:8
|
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 12:16:29 +00:00
--> tests/ui/comparison_to_empty.rs:18:8
|
LL | if let [] = &*s
| ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.is_empty()`
error: comparison to empty slice
2024-02-17 12:16:29 +00:00
--> tests/ui/comparison_to_empty.rs:19:12
|
LL | && s == []
| ^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.is_empty()`
error: comparison to empty slice
--> tests/ui/comparison_to_empty.rs:39:13
|
LL | let _ = s.eq("");
| ^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.is_empty()`
error: comparison to empty slice
--> tests/ui/comparison_to_empty.rs:40:13
|
LL | let _ = s.ne("");
| ^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!s.is_empty()`
error: comparison to empty slice
--> tests/ui/comparison_to_empty.rs:42:13
|
LL | let _ = v.eq(&[]);
| ^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `v.is_empty()`
error: comparison to empty slice
--> tests/ui/comparison_to_empty.rs:43:13
|
LL | let _ = v.ne(&[]);
| ^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!v.is_empty()`
error: aborting due to 13 previous errors