]> git.lizzy.rs Git - rust.git/blob - tests/ui/manual_map_option_2.stderr
Auto merge of #7453 - F3real:assume_function_calls_have_side_effect, r=flip1995
[rust.git] / tests / ui / manual_map_option_2.stderr
1 error: manual implementation of `Option::map`
2   --> $DIR/manual_map_option_2.rs:8:13
3    |
4 LL |       let _ = match Some(0) {
5    |  _____________^
6 LL | |         Some(x) => Some({
7 LL | |             let y = (String::new(), String::new());
8 LL | |             (x, y.0)
9 LL | |         }),
10 LL | |         None => None,
11 LL | |     };
12    | |_____^
13    |
14    = note: `-D clippy::manual-map` implied by `-D warnings`
15 help: try this
16    |
17 LL ~     let _ = Some(0).map(|x| {
18 LL +             let y = (String::new(), String::new());
19 LL +             (x, y.0)
20 LL ~         });
21    |
22
23 error: manual implementation of `Option::map`
24   --> $DIR/manual_map_option_2.rs:50:13
25    |
26 LL |       let _ = match &s {
27    |  _____________^
28 LL | |         Some(x) => Some({
29 LL | |             if let Some(ref s) = s { (x.clone(), s) } else { panic!() }
30 LL | |         }),
31 LL | |         None => None,
32 LL | |     };
33    | |_____^
34    |
35 help: try this
36    |
37 LL ~     let _ = s.as_ref().map(|x| {
38 LL +             if let Some(ref s) = s { (x.clone(), s) } else { panic!() }
39 LL ~         });
40    |
41
42 error: aborting due to 2 previous errors
43