Rollup merge of #88772 - orlp:result-map-or-else-docfix, r=yaahc

Fixed confusing wording on Result::map_or_else.

Fixes https://github.com/rust-lang/rust/issues/88195.
This commit is contained in:
Jubilee 2021-10-07 20:26:11 -07:00 committed by GitHub
commit 2b6d7f75f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -795,9 +795,8 @@ impl<T, E> Result<T, E> {
}
}
/// Maps a `Result<T, E>` to `U` by applying a provided default fallback
/// function to a contained [`Err`] value, or a provided function to a
/// contained [`Ok`] value.
/// Maps a `Result<T, E>` to `U` by applying fallback function `default` to
/// a contained [`Err`] value, or function `f` to a contained [`Ok`] value.
///
/// This function can be used to unpack a successful result
/// while handling an error.