summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/manual_map_option_2.stderr
blob: d35b6252fb8704fc377666eb5d0197006db7ef59 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
error: manual implementation of `Option::map`
  --> $DIR/manual_map_option_2.rs:8:13
   |
LL |       let _ = match Some(0) {
   |  _____________^
LL | |         Some(x) => Some({
LL | |             let y = (String::new(), String::new());
LL | |             (x, y.0)
LL | |         }),
LL | |         None => None,
LL | |     };
   | |_____^
   |
   = note: `-D clippy::manual-map` implied by `-D warnings`
help: try this
   |
LL ~     let _ = Some(0).map(|x| {
LL +             let y = (String::new(), String::new());
LL +             (x, y.0)
LL ~         });
   |

error: manual implementation of `Option::map`
  --> $DIR/manual_map_option_2.rs:50:13
   |
LL |       let _ = match &s {
   |  _____________^
LL | |         Some(x) => Some({
LL | |             if let Some(ref s) = s { (x.clone(), s) } else { panic!() }
LL | |         }),
LL | |         None => None,
LL | |     };
   | |_____^
   |
help: try this
   |
LL ~     let _ = s.as_ref().map(|x| {
LL +             if let Some(ref s) = s { (x.clone(), s) } else { panic!() }
LL ~         });
   |

error: manual implementation of `Option::map`
  --> $DIR/manual_map_option_2.rs:62:17
   |
LL |           let _ = match Some(0) {
   |  _________________^
LL | |             Some(x) => Some(f(x)),
LL | |             None => None,
LL | |         };
   | |_________^ help: try this: `Some(0).map(|x| f(x))`

error: manual implementation of `Option::map`
  --> $DIR/manual_map_option_2.rs:67:13
   |
LL |       let _ = match Some(0) {
   |  _____________^
LL | |         Some(x) => unsafe { Some(f(x)) },
LL | |         None => None,
LL | |     };
   | |_____^ help: try this: `Some(0).map(|x| unsafe { f(x) })`

error: manual implementation of `Option::map`
  --> $DIR/manual_map_option_2.rs:71:13
   |
LL |       let _ = match Some(0) {
   |  _____________^
LL | |         Some(x) => Some(unsafe { f(x) }),
LL | |         None => None,
LL | |     };
   | |_____^ help: try this: `Some(0).map(|x| unsafe { f(x) })`

error: aborting due to 5 previous errors