Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#66292 - lzutao:result-map_or, r=SimonSapin
add Result::map_or This PR adds this API to make it consistent with `Option::map_or`. ```rust impl<T, E> Result<T, E> { pub fn map_or<U, F: FnOnce(T) -> U>(self, default: U, f: F) -> U { match self { Ok(t) => f(t), Err(_) => default, } } } ``` This API is very small. We already has a similar API for `Option::map_or`.
- Loading branch information