Files
rust/tests/ui/manual_is_variant_and.stderr

89 lines
2.7 KiB
Plaintext
Raw Normal View History

2023-11-24 20:56:57 -05:00
error: called `map(<f>).unwrap_or_default()` on an `Option` value
2024-02-17 12:16:29 +00:00
--> tests/ui/manual_is_variant_and.rs:13:17
2023-11-24 20:56:57 -05:00
|
LL | let _ = opt.map(|x| x > 1)
| _________________^
2025-02-11 17:57:08 +01:00
... |
2023-11-24 20:56:57 -05:00
LL | | .unwrap_or_default();
| |____________________________^ help: use: `is_some_and(|x| x > 1)`
|
= note: `-D clippy::manual-is-variant-and` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::manual_is_variant_and)]`
error: called `map(<f>).unwrap_or_default()` on an `Option` value
2025-02-11 17:57:08 +01:00
--> tests/ui/manual_is_variant_and.rs:18:17
2023-11-24 20:56:57 -05:00
|
LL | let _ = opt.map(|x| {
| _________________^
2025-02-11 17:57:08 +01:00
LL | |
2023-11-24 20:56:57 -05:00
LL | | x > 1
LL | | }
LL | | ).unwrap_or_default();
| |_________________________^
|
help: use
|
LL ~ let _ = opt.is_some_and(|x| {
2025-02-11 17:57:08 +01:00
LL +
2023-11-24 20:56:57 -05:00
LL + x > 1
LL ~ });
|
error: called `map(<f>).unwrap_or_default()` on an `Option` value
2025-02-11 17:57:08 +01:00
--> tests/ui/manual_is_variant_and.rs:23:17
2023-11-24 20:56:57 -05:00
|
LL | let _ = opt.map(|x| x > 1).unwrap_or_default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `is_some_and(|x| x > 1)`
error: called `map(<f>).unwrap_or_default()` on an `Option` value
2025-02-11 17:57:08 +01:00
--> tests/ui/manual_is_variant_and.rs:26:10
2023-11-24 20:56:57 -05:00
|
LL | .map(|x| x > 1)
| __________^
2025-02-11 17:57:08 +01:00
LL | |
2023-11-24 20:56:57 -05:00
LL | | .unwrap_or_default();
| |____________________________^ help: use: `is_some_and(|x| x > 1)`
error: called `map(<f>).unwrap_or_default()` on an `Option` value
2025-02-11 17:57:08 +01:00
--> tests/ui/manual_is_variant_and.rs:34:18
2023-11-24 20:56:57 -05:00
|
LL | let _ = opt2.map(char::is_alphanumeric).unwrap_or_default(); // should lint
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `is_some_and(char::is_alphanumeric)`
error: called `map(<f>).unwrap_or_default()` on a `Result` value
2025-02-11 17:57:08 +01:00
--> tests/ui/manual_is_variant_and.rs:44:17
2023-11-24 20:56:57 -05:00
|
LL | let _ = res.map(|x| {
| _________________^
2025-02-11 17:57:08 +01:00
LL | |
2023-11-24 20:56:57 -05:00
LL | | x > 1
LL | | }
LL | | ).unwrap_or_default();
| |_________________________^
|
help: use
|
LL ~ let _ = res.is_ok_and(|x| {
2025-02-11 17:57:08 +01:00
LL +
2023-11-24 20:56:57 -05:00
LL + x > 1
LL ~ });
|
error: called `map(<f>).unwrap_or_default()` on a `Result` value
2025-02-11 17:57:08 +01:00
--> tests/ui/manual_is_variant_and.rs:49:17
2023-11-24 20:56:57 -05:00
|
LL | let _ = res.map(|x| x > 1)
| _________________^
2025-02-11 17:57:08 +01:00
LL | |
2023-11-24 20:56:57 -05:00
LL | | .unwrap_or_default();
| |____________________________^ help: use: `is_ok_and(|x| x > 1)`
error: called `map(<f>).unwrap_or_default()` on a `Result` value
2025-02-11 17:57:08 +01:00
--> tests/ui/manual_is_variant_and.rs:57:18
2023-11-24 20:56:57 -05:00
|
LL | let _ = res2.map(char::is_alphanumeric).unwrap_or_default(); // should lint
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `is_ok_and(char::is_alphanumeric)`
error: aborting due to 8 previous errors