2
0
Fork 0
mirror of https://github.com/rust-lang/rust-clippy synced 2024-12-24 12:03:28 +00:00
rust-clippy/tests/ui/bind_instead_of_map.stderr

27 lines
900 B
Text
Raw Normal View History

2019-08-15 03:53:11 +00:00
error: using `Option.and_then(Some)`, which is a no-op
2024-02-17 12:16:29 +00:00
--> tests/ui/bind_instead_of_map.rs:8:13
2019-08-15 03:53:11 +00:00
|
LL | let _ = x.and_then(Some);
| ^^^^^^^^^^^^^^^^ help: use the expression directly: `x`
|
2020-01-31 19:21:10 +00:00
note: the lint level is defined here
2024-02-17 12:16:29 +00:00
--> tests/ui/bind_instead_of_map.rs:1:9
2019-08-15 03:53:11 +00:00
|
LL | #![deny(clippy::bind_instead_of_map)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2019-08-15 03:53:11 +00:00
error: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
2024-02-17 12:16:29 +00:00
--> tests/ui/bind_instead_of_map.rs:9:13
2019-08-15 03:53:11 +00:00
|
LL | let _ = x.and_then(|o| Some(o + 1));
2023-07-01 11:08:01 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x.map(|o| o + 1)`
2019-08-15 03:53:11 +00:00
error: using `Result.and_then(Ok)`, which is a no-op
2024-02-17 12:16:29 +00:00
--> tests/ui/bind_instead_of_map.rs:15:13
|
LL | let _ = x.and_then(Ok);
| ^^^^^^^^^^^^^^ help: use the expression directly: `x`
error: aborting due to 3 previous errors
2019-08-15 03:53:11 +00:00