Commit 8212a1c
authored
Rollup merge of rust-lang#70140 - Nemo157:result-flatten, r=Amanieu
Add Result<Result<T, E>, E>::flatten -> Result<T, E>
This PR makes this possible (modulo type inference):
```rust
assert_eq!(Ok(6), Ok(Ok(6)).flatten());
```
Tracking issue: rust-lang#70142
<sub>largely cribbed directly from <https://github.com/rust-lang/rust/pull/60256></sub>1 file changed
+33
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
234 | 233 | | |
235 | 234 | | |
| 235 | + | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| |||
1214 | 1214 | | |
1215 | 1215 | | |
1216 | 1216 | | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
1217 | 1249 | | |
1218 | 1250 | | |
1219 | 1251 | | |
| |||
0 commit comments