2019-08-14 22:53:11 -05:00
|
|
|
error: using `Option.and_then(Some)`, which is a no-op
|
2022-10-06 02:44:38 -05:00
|
|
|
--> $DIR/bind_instead_of_map.rs:9:13
|
2019-08-14 22:53:11 -05:00
|
|
|
|
|
|
|
|
LL | let _ = x.and_then(Some);
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: use the expression directly: `x`
|
|
|
|
|
|
2020-01-31 13:21:10 -06:00
|
|
|
note: the lint level is defined here
|
2020-05-17 10:36:26 -05:00
|
|
|
--> $DIR/bind_instead_of_map.rs:2:9
|
2019-08-14 22:53:11 -05:00
|
|
|
|
|
2020-05-17 10:36:26 -05:00
|
|
|
LL | #![deny(clippy::bind_instead_of_map)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2019-08-14 22:53:11 -05:00
|
|
|
|
|
|
|
error: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
|
2022-10-06 02:44:38 -05:00
|
|
|
--> $DIR/bind_instead_of_map.rs:10:13
|
2019-08-14 22:53:11 -05:00
|
|
|
|
|
|
|
|
LL | let _ = x.and_then(|o| Some(o + 1));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `x.map(|o| o + 1)`
|
|
|
|
|
2020-05-17 10:36:26 -05:00
|
|
|
error: using `Result.and_then(Ok)`, which is a no-op
|
2022-10-06 02:44:38 -05:00
|
|
|
--> $DIR/bind_instead_of_map.rs:16:13
|
2020-05-17 10:36:26 -05:00
|
|
|
|
|
|
|
|
LL | let _ = x.and_then(Ok);
|
|
|
|
| ^^^^^^^^^^^^^^ help: use the expression directly: `x`
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
2019-08-14 22:53:11 -05:00
|
|
|
|