]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/bind_instead_of_map.stderr
Merge commit 'd9ddce8a223cb9916389c039777b6966ea448dc8' into clippyup
[rust.git] / src / tools / clippy / tests / ui / bind_instead_of_map.stderr
1 error: using `Option.and_then(Some)`, which is a no-op
2   --> $DIR/bind_instead_of_map.rs:8:13
3    |
4 LL |     let _ = x.and_then(Some);
5    |             ^^^^^^^^^^^^^^^^ help: use the expression directly: `x`
6    |
7 note: the lint level is defined here
8   --> $DIR/bind_instead_of_map.rs:2:9
9    |
10 LL | #![deny(clippy::bind_instead_of_map)]
11    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
12
13 error: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
14   --> $DIR/bind_instead_of_map.rs:9:13
15    |
16 LL |     let _ = x.and_then(|o| Some(o + 1));
17    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `x.map(|o| o + 1)`
18
19 error: using `Result.and_then(Ok)`, which is a no-op
20   --> $DIR/bind_instead_of_map.rs:15:13
21    |
22 LL |     let _ = x.and_then(Ok);
23    |             ^^^^^^^^^^^^^^ help: use the expression directly: `x`
24
25 error: aborting due to 3 previous errors
26