|
1 | 1 | error: called `map(f)` on an Result value where `f` is a unit function
|
2 |
| - --> $DIR/result_map_unit_fn.rs:32:5 |
| 2 | + --> $DIR/result_map_unit_fn.rs:33:5 |
3 | 3 | |
|
4 |
| -32 | x.field.map(do_nothing); |
| 4 | +33 | x.field.map(do_nothing); |
5 | 5 | | ^^^^^^^^^^^^^^^^^^^^^^^-
|
6 | 6 | | |
|
7 | 7 | | help: try this: `if let Ok(x_field) = x.field { do_nothing(...) }`
|
8 | 8 | |
|
9 | 9 | = note: `-D result-map-unit-fn` implied by `-D warnings`
|
10 | 10 |
|
11 | 11 | error: called `map(f)` on an Result value where `f` is a unit function
|
12 |
| - --> $DIR/result_map_unit_fn.rs:34:5 |
| 12 | + --> $DIR/result_map_unit_fn.rs:35:5 |
13 | 13 | |
|
14 |
| -34 | x.field.map(do_nothing); |
| 14 | +35 | x.field.map(do_nothing); |
15 | 15 | | ^^^^^^^^^^^^^^^^^^^^^^^-
|
16 | 16 | | |
|
17 | 17 | | help: try this: `if let Ok(x_field) = x.field { do_nothing(...) }`
|
18 | 18 |
|
19 | 19 | error: called `map(f)` on an Result value where `f` is a unit function
|
20 |
| - --> $DIR/result_map_unit_fn.rs:36:5 |
| 20 | + --> $DIR/result_map_unit_fn.rs:37:5 |
21 | 21 | |
|
22 |
| -36 | x.field.map(diverge); |
| 22 | +37 | x.field.map(diverge); |
23 | 23 | | ^^^^^^^^^^^^^^^^^^^^-
|
24 | 24 | | |
|
25 | 25 | | help: try this: `if let Ok(x_field) = x.field { diverge(...) }`
|
26 | 26 |
|
27 | 27 | error: called `map(f)` on an Result value where `f` is a unit closure
|
28 |
| - --> $DIR/result_map_unit_fn.rs:42:5 |
| 28 | + --> $DIR/result_map_unit_fn.rs:43:5 |
29 | 29 | |
|
30 |
| -42 | x.field.map(|value| x.do_result_nothing(value + captured)); |
| 30 | +43 | x.field.map(|value| x.do_result_nothing(value + captured)); |
31 | 31 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
32 | 32 | | |
|
33 | 33 | | help: try this: `if let Ok(value) = x.field { x.do_result_nothing(value + captured) }`
|
34 | 34 |
|
35 | 35 | error: called `map(f)` on an Result value where `f` is a unit closure
|
36 |
| - --> $DIR/result_map_unit_fn.rs:44:5 |
| 36 | + --> $DIR/result_map_unit_fn.rs:45:5 |
37 | 37 | |
|
38 |
| -44 | x.field.map(|value| { x.do_result_plus_one(value + captured); }); |
| 38 | +45 | x.field.map(|value| { x.do_result_plus_one(value + captured); }); |
39 | 39 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
40 | 40 | | |
|
41 | 41 | | help: try this: `if let Ok(value) = x.field { x.do_result_plus_one(value + captured); }`
|
42 | 42 |
|
43 | 43 | error: called `map(f)` on an Result value where `f` is a unit closure
|
44 |
| - --> $DIR/result_map_unit_fn.rs:47:5 |
| 44 | + --> $DIR/result_map_unit_fn.rs:48:5 |
45 | 45 | |
|
46 |
| -47 | x.field.map(|value| do_nothing(value + captured)); |
| 46 | +48 | x.field.map(|value| do_nothing(value + captured)); |
47 | 47 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
48 | 48 | | |
|
49 | 49 | | help: try this: `if let Ok(value) = x.field { do_nothing(value + captured) }`
|
50 | 50 |
|
51 | 51 | error: called `map(f)` on an Result value where `f` is a unit closure
|
52 |
| - --> $DIR/result_map_unit_fn.rs:49:5 |
| 52 | + --> $DIR/result_map_unit_fn.rs:50:5 |
53 | 53 | |
|
54 |
| -49 | x.field.map(|value| { do_nothing(value + captured) }); |
| 54 | +50 | x.field.map(|value| { do_nothing(value + captured) }); |
55 | 55 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
56 | 56 | | |
|
57 | 57 | | help: try this: `if let Ok(value) = x.field { do_nothing(value + captured) }`
|
58 | 58 |
|
59 | 59 | error: called `map(f)` on an Result value where `f` is a unit closure
|
60 |
| - --> $DIR/result_map_unit_fn.rs:51:5 |
| 60 | + --> $DIR/result_map_unit_fn.rs:52:5 |
61 | 61 | |
|
62 |
| -51 | x.field.map(|value| { do_nothing(value + captured); }); |
| 62 | +52 | x.field.map(|value| { do_nothing(value + captured); }); |
63 | 63 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
64 | 64 | | |
|
65 | 65 | | help: try this: `if let Ok(value) = x.field { do_nothing(value + captured); }`
|
66 | 66 |
|
67 | 67 | error: called `map(f)` on an Result value where `f` is a unit closure
|
68 |
| - --> $DIR/result_map_unit_fn.rs:53:5 |
| 68 | + --> $DIR/result_map_unit_fn.rs:54:5 |
69 | 69 | |
|
70 |
| -53 | x.field.map(|value| { { do_nothing(value + captured); } }); |
| 70 | +54 | x.field.map(|value| { { do_nothing(value + captured); } }); |
71 | 71 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
72 | 72 | | |
|
73 | 73 | | help: try this: `if let Ok(value) = x.field { do_nothing(value + captured); }`
|
74 | 74 |
|
75 | 75 | error: called `map(f)` on an Result value where `f` is a unit closure
|
76 |
| - --> $DIR/result_map_unit_fn.rs:56:5 |
| 76 | + --> $DIR/result_map_unit_fn.rs:57:5 |
77 | 77 | |
|
78 |
| -56 | x.field.map(|value| diverge(value + captured)); |
| 78 | +57 | x.field.map(|value| diverge(value + captured)); |
79 | 79 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
80 | 80 | | |
|
81 | 81 | | help: try this: `if let Ok(value) = x.field { diverge(value + captured) }`
|
82 | 82 |
|
83 | 83 | error: called `map(f)` on an Result value where `f` is a unit closure
|
84 |
| - --> $DIR/result_map_unit_fn.rs:58:5 |
| 84 | + --> $DIR/result_map_unit_fn.rs:59:5 |
85 | 85 | |
|
86 |
| -58 | x.field.map(|value| { diverge(value + captured) }); |
| 86 | +59 | x.field.map(|value| { diverge(value + captured) }); |
87 | 87 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
88 | 88 | | |
|
89 | 89 | | help: try this: `if let Ok(value) = x.field { diverge(value + captured) }`
|
90 | 90 |
|
91 | 91 | error: called `map(f)` on an Result value where `f` is a unit closure
|
92 |
| - --> $DIR/result_map_unit_fn.rs:60:5 |
| 92 | + --> $DIR/result_map_unit_fn.rs:61:5 |
93 | 93 | |
|
94 |
| -60 | x.field.map(|value| { diverge(value + captured); }); |
| 94 | +61 | x.field.map(|value| { diverge(value + captured); }); |
95 | 95 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
96 | 96 | | |
|
97 | 97 | | help: try this: `if let Ok(value) = x.field { diverge(value + captured); }`
|
98 | 98 |
|
99 | 99 | error: called `map(f)` on an Result value where `f` is a unit closure
|
100 |
| - --> $DIR/result_map_unit_fn.rs:62:5 |
| 100 | + --> $DIR/result_map_unit_fn.rs:63:5 |
101 | 101 | |
|
102 |
| -62 | x.field.map(|value| { { diverge(value + captured); } }); |
| 102 | +63 | x.field.map(|value| { { diverge(value + captured); } }); |
103 | 103 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
104 | 104 | | |
|
105 | 105 | | help: try this: `if let Ok(value) = x.field { diverge(value + captured); }`
|
106 | 106 |
|
107 | 107 | error: called `map(f)` on an Result value where `f` is a unit closure
|
108 |
| - --> $DIR/result_map_unit_fn.rs:67:5 |
| 108 | + --> $DIR/result_map_unit_fn.rs:68:5 |
109 | 109 | |
|
110 |
| -67 | x.field.map(|value| { let y = plus_one(value + captured); }); |
| 110 | +68 | x.field.map(|value| { let y = plus_one(value + captured); }); |
111 | 111 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
112 | 112 | | |
|
113 | 113 | | help: try this: `if let Ok(value) = x.field { let y = plus_one(value + captured); }`
|
114 | 114 |
|
115 | 115 | error: called `map(f)` on an Result value where `f` is a unit closure
|
116 |
| - --> $DIR/result_map_unit_fn.rs:69:5 |
| 116 | + --> $DIR/result_map_unit_fn.rs:70:5 |
117 | 117 | |
|
118 |
| -69 | x.field.map(|value| { plus_one(value + captured); }); |
| 118 | +70 | x.field.map(|value| { plus_one(value + captured); }); |
119 | 119 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
120 | 120 | | |
|
121 | 121 | | help: try this: `if let Ok(value) = x.field { plus_one(value + captured); }`
|
122 | 122 |
|
123 | 123 | error: called `map(f)` on an Result value where `f` is a unit closure
|
124 |
| - --> $DIR/result_map_unit_fn.rs:71:5 |
| 124 | + --> $DIR/result_map_unit_fn.rs:72:5 |
125 | 125 | |
|
126 |
| -71 | x.field.map(|value| { { plus_one(value + captured); } }); |
| 126 | +72 | x.field.map(|value| { { plus_one(value + captured); } }); |
127 | 127 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
128 | 128 | | |
|
129 | 129 | | help: try this: `if let Ok(value) = x.field { plus_one(value + captured); }`
|
130 | 130 |
|
131 | 131 | error: called `map(f)` on an Result value where `f` is a unit closure
|
132 |
| - --> $DIR/result_map_unit_fn.rs:74:5 |
| 132 | + --> $DIR/result_map_unit_fn.rs:75:5 |
133 | 133 | |
|
134 |
| -74 | x.field.map(|ref value| { do_nothing(value + captured) }); |
| 134 | +75 | x.field.map(|ref value| { do_nothing(value + captured) }); |
135 | 135 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
136 | 136 | | |
|
137 | 137 | | help: try this: `if let Ok(ref value) = x.field { do_nothing(value + captured) }`
|
138 | 138 |
|
139 | 139 | error: called `map(f)` on an Result value where `f` is a unit closure
|
140 |
| - --> $DIR/result_map_unit_fn.rs:77:5 |
| 140 | + --> $DIR/result_map_unit_fn.rs:78:5 |
141 | 141 | |
|
142 |
| -77 | x.field.map(|value| { do_nothing(value); do_nothing(value) }); |
| 142 | +78 | x.field.map(|value| { do_nothing(value); do_nothing(value) }); |
143 | 143 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
144 | 144 | | |
|
145 | 145 | | help: try this: `if let Ok(value) = x.field { ... }`
|
146 | 146 |
|
147 | 147 | error: called `map(f)` on an Result value where `f` is a unit closure
|
148 |
| - --> $DIR/result_map_unit_fn.rs:79:5 |
| 148 | + --> $DIR/result_map_unit_fn.rs:80:5 |
149 | 149 | |
|
150 |
| -79 | x.field.map(|value| if value > 0 { do_nothing(value); do_nothing(value) }); |
| 150 | +80 | x.field.map(|value| if value > 0 { do_nothing(value); do_nothing(value) }); |
151 | 151 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
152 | 152 | | |
|
153 | 153 | | help: try this: `if let Ok(value) = x.field { ... }`
|
154 | 154 |
|
155 | 155 | error: called `map(f)` on an Result value where `f` is a unit closure
|
156 |
| - --> $DIR/result_map_unit_fn.rs:83:5 |
| 156 | + --> $DIR/result_map_unit_fn.rs:84:5 |
157 | 157 | |
|
158 |
| -83 | x.field.map(|value| { |
| 158 | +84 | x.field.map(|value| { |
159 | 159 | | _____^
|
160 | 160 | | |_____|
|
161 | 161 | | ||
|
162 |
| -84 | || do_nothing(value); |
163 |
| -85 | || do_nothing(value) |
164 |
| -86 | || }); |
| 162 | +85 | || do_nothing(value); |
| 163 | +86 | || do_nothing(value) |
| 164 | +87 | || }); |
165 | 165 | | ||______^- help: try this: `if let Ok(value) = x.field { ... }`
|
166 | 166 | | |_______|
|
167 | 167 | |
|
168 | 168 |
|
169 | 169 | error: called `map(f)` on an Result value where `f` is a unit closure
|
170 |
| - --> $DIR/result_map_unit_fn.rs:87:5 |
| 170 | + --> $DIR/result_map_unit_fn.rs:88:5 |
171 | 171 | |
|
172 |
| -87 | x.field.map(|value| { do_nothing(value); do_nothing(value); }); |
| 172 | +88 | x.field.map(|value| { do_nothing(value); do_nothing(value); }); |
173 | 173 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
174 | 174 | | |
|
175 | 175 | | help: try this: `if let Ok(value) = x.field { ... }`
|
176 | 176 |
|
177 | 177 | error: called `map(f)` on an Result value where `f` is a unit function
|
178 |
| - --> $DIR/result_map_unit_fn.rs:91:5 |
| 178 | + --> $DIR/result_map_unit_fn.rs:92:5 |
179 | 179 | |
|
180 |
| -91 | "12".parse::<i32>().map(diverge); |
| 180 | +92 | "12".parse::<i32>().map(diverge); |
181 | 181 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
182 | 182 | | |
|
183 | 183 | | help: try this: `if let Ok(_) = "12".parse::<i32>() { diverge(...) }`
|
184 | 184 |
|
185 | 185 | error: called `map(f)` on an Result value where `f` is a unit function
|
186 |
| - --> $DIR/result_map_unit_fn.rs:97:5 |
| 186 | + --> $DIR/result_map_unit_fn.rs:98:5 |
187 | 187 | |
|
188 |
| -97 | y.map(do_nothing); |
| 188 | +98 | y.map(do_nothing); |
189 | 189 | | ^^^^^^^^^^^^^^^^^-
|
190 | 190 | | |
|
191 | 191 | | help: try this: `if let Ok(_y) = y { do_nothing(...) }`
|
|
0 commit comments