summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/bind_instead_of_map.stderr
blob: f17fee7460dc2cd08cbe93308026d68f23f942ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
error: using `Option.and_then(Some)`, which is a no-op
  --> $DIR/bind_instead_of_map.rs:9:13
   |
LL |     let _ = x.and_then(Some);
   |             ^^^^^^^^^^^^^^^^ help: use the expression directly: `x`
   |
note: the lint level is defined here
  --> $DIR/bind_instead_of_map.rs:2:9
   |
LL | #![deny(clippy::bind_instead_of_map)]
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
  --> $DIR/bind_instead_of_map.rs:10:13
   |
LL |     let _ = x.and_then(|o| Some(o + 1));
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x.map(|o| o + 1)`

error: using `Result.and_then(Ok)`, which is a no-op
  --> $DIR/bind_instead_of_map.rs:16:13
   |
LL |     let _ = x.and_then(Ok);
   |             ^^^^^^^^^^^^^^ help: use the expression directly: `x`

error: aborting due to 3 previous errors