Commit 7d761fe
committed
Auto merge of #66322 - lzutao:consistent-result-map_or_else, r=dtolnay
Stabilize Result::map_or_else
Stabilized this API:
```rust
impl<T, E> Result<T, E> {
pub fn map_or_else<U, D: FnOnce(E) -> U, F: FnOnce(T) -> U>(self, default: D, f: F) -> U {
match self {
Ok(t) => f(t),
Err(e) => default(e),
}
}
}
```
Closes #53268
r? @SimonSapin1 file changed
+6
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
554 | | - | |
555 | 554 | | |
556 | 555 | | |
557 | 556 | | |
| |||
561 | 560 | | |
562 | 561 | | |
563 | 562 | | |
564 | | - | |
565 | | - | |
566 | | - | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
567 | 569 | | |
568 | 570 | | |
569 | 571 | | |
| |||
0 commit comments