Files
rust/src/libcore
Yuki Okushi 961d51dcbb Rollup merge of #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`.
2019-11-13 22:09:20 +09:00
..
2019-11-12 16:36:57 -05:00
2019-11-12 16:36:57 -05:00
2019-11-12 16:36:57 -05:00
2019-11-12 16:36:57 -05:00
2019-10-12 15:18:17 +02:00
2019-11-06 11:04:42 +01:00
2019-09-25 08:42:46 -04:00
2019-11-13 09:31:08 +01:00
2019-09-25 08:42:46 -04:00
2019-11-12 16:36:57 -05:00
2019-09-25 08:42:46 -04:00
2018-12-25 21:08:33 -07:00
2019-11-12 16:36:57 -05:00
2019-11-12 16:36:57 -05:00
2019-11-12 16:36:57 -05:00
2019-11-12 16:36:57 -05:00
2019-11-12 16:36:57 -05:00
2019-11-12 03:22:04 +00:00
2019-04-18 14:47:35 +09:00
2019-04-18 14:47:35 +09:00