mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-17 05:25:37 +03:00
7d761fe046
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? @SimonSapin