]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/result_map_unit_fn_fixable.stderr
New upstream version 1.62.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / result_map_unit_fn_fixable.stderr
CommitLineData
f20569fa
XL
1error: called `map(f)` on an `Result` value where `f` is a function that returns the unit type `()`
2 --> $DIR/result_map_unit_fn_fixable.rs:35:5
3 |
4LL | x.field.map(do_nothing);
5 | ^^^^^^^^^^^^^^^^^^^^^^^-
6 | |
7 | help: try this: `if let Ok(x_field) = x.field { do_nothing(x_field) }`
8 |
9 = note: `-D clippy::result-map-unit-fn` implied by `-D warnings`
10
11error: called `map(f)` on an `Result` value where `f` is a function that returns the unit type `()`
12 --> $DIR/result_map_unit_fn_fixable.rs:37:5
13 |
14LL | x.field.map(do_nothing);
15 | ^^^^^^^^^^^^^^^^^^^^^^^-
16 | |
17 | help: try this: `if let Ok(x_field) = x.field { do_nothing(x_field) }`
18
19error: called `map(f)` on an `Result` value where `f` is a function that returns the unit type `()`
20 --> $DIR/result_map_unit_fn_fixable.rs:39:5
21 |
22LL | x.field.map(diverge);
23 | ^^^^^^^^^^^^^^^^^^^^-
24 | |
25 | help: try this: `if let Ok(x_field) = x.field { diverge(x_field) }`
26
27error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
28 --> $DIR/result_map_unit_fn_fixable.rs:45:5
29 |
30LL | x.field.map(|value| x.do_result_nothing(value + captured));
31 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
32 | |
33 | help: try this: `if let Ok(value) = x.field { x.do_result_nothing(value + captured) }`
34
35error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
36 --> $DIR/result_map_unit_fn_fixable.rs:47:5
37 |
38LL | x.field.map(|value| { x.do_result_plus_one(value + captured); });
39 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
40 | |
41 | help: try this: `if let Ok(value) = x.field { x.do_result_plus_one(value + captured); }`
42
43error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
44 --> $DIR/result_map_unit_fn_fixable.rs:50:5
45 |
46LL | x.field.map(|value| do_nothing(value + captured));
47 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
48 | |
49 | help: try this: `if let Ok(value) = x.field { do_nothing(value + captured) }`
50
51error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
52 --> $DIR/result_map_unit_fn_fixable.rs:52:5
53 |
54LL | x.field.map(|value| { do_nothing(value + captured) });
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
56 | |
57 | help: try this: `if let Ok(value) = x.field { do_nothing(value + captured) }`
58
59error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
60 --> $DIR/result_map_unit_fn_fixable.rs:54:5
61 |
62LL | x.field.map(|value| { do_nothing(value + captured); });
63 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
64 | |
65 | help: try this: `if let Ok(value) = x.field { do_nothing(value + captured); }`
66
67error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
68 --> $DIR/result_map_unit_fn_fixable.rs:56:5
69 |
70LL | x.field.map(|value| { { do_nothing(value + captured); } });
71 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
72 | |
73 | help: try this: `if let Ok(value) = x.field { do_nothing(value + captured); }`
74
75error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
76 --> $DIR/result_map_unit_fn_fixable.rs:59:5
77 |
78LL | x.field.map(|value| diverge(value + captured));
79 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
80 | |
81 | help: try this: `if let Ok(value) = x.field { diverge(value + captured) }`
82
83error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
84 --> $DIR/result_map_unit_fn_fixable.rs:61:5
85 |
86LL | x.field.map(|value| { diverge(value + captured) });
87 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
88 | |
89 | help: try this: `if let Ok(value) = x.field { diverge(value + captured) }`
90
91error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
92 --> $DIR/result_map_unit_fn_fixable.rs:63:5
93 |
94LL | x.field.map(|value| { diverge(value + captured); });
95 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
96 | |
97 | help: try this: `if let Ok(value) = x.field { diverge(value + captured); }`
98
99error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
100 --> $DIR/result_map_unit_fn_fixable.rs:65:5
101 |
102LL | x.field.map(|value| { { diverge(value + captured); } });
103 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
104 | |
105 | help: try this: `if let Ok(value) = x.field { diverge(value + captured); }`
106
107error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
108 --> $DIR/result_map_unit_fn_fixable.rs:70:5
109 |
110LL | x.field.map(|value| { let y = plus_one(value + captured); });
111 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
112 | |
113 | help: try this: `if let Ok(value) = x.field { let y = plus_one(value + captured); }`
114
115error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
116 --> $DIR/result_map_unit_fn_fixable.rs:72:5
117 |
118LL | x.field.map(|value| { plus_one(value + captured); });
119 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
120 | |
121 | help: try this: `if let Ok(value) = x.field { plus_one(value + captured); }`
122
123error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
124 --> $DIR/result_map_unit_fn_fixable.rs:74:5
125 |
126LL | x.field.map(|value| { { plus_one(value + captured); } });
127 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
128 | |
129 | help: try this: `if let Ok(value) = x.field { plus_one(value + captured); }`
130
131error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
132 --> $DIR/result_map_unit_fn_fixable.rs:77:5
133 |
134LL | x.field.map(|ref value| { do_nothing(value + captured) });
135 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
136 | |
137 | help: try this: `if let Ok(ref value) = x.field { do_nothing(value + captured) }`
138
04454e1e
FG
139error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
140 --> $DIR/result_map_unit_fn_fixable.rs:79:5
141 |
142LL | x.field.map(|value| println!("{:?}", value));
143 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
144 | |
145 | help: try this: `if let Ok(value) = x.field { println!("{:?}", value) }`
146
147error: aborting due to 18 previous errors
f20569fa 148