diff options
| author | Jubilee <46493976+workingjubilee@users.noreply.github.com> | 2021-10-04 13:58:09 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-04 13:58:09 -0700 |
| commit | 9e387cf27e6e26957f085e6da3b898539870ea2f (patch) | |
| tree | 49abaf42c2fc2dbd81610eac3047f3057bc46415 | |
| parent | 19d9a147bef8dfaf5c718c0cb4008accd86e7a5e (diff) | |
| parent | 35b0015b09ad3c2b69b7f00f0f4685e6eafa5628 (diff) | |
| download | rust-9e387cf27e6e26957f085e6da3b898539870ea2f.tar.gz rust-9e387cf27e6e26957f085e6da3b898539870ea2f.zip | |
Rollup merge of #89400 - Nitepone:nitepone/map-or-else-docfix, r=dtolnay
Improve wording of `map_or_else` docs Changes doc text to refer to the "default" parameter as the "default" function. Previously, the doc text referred to the "f" parameter as the "default" function; and the "default" parameter as the "fallback" function.
| -rw-r--r-- | library/core/src/result.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/library/core/src/result.rs b/library/core/src/result.rs index a34964b531d..c9c2d2e645a 100644 --- a/library/core/src/result.rs +++ b/library/core/src/result.rs @@ -329,8 +329,8 @@ //! [`Ok`], or returns the provided default value if the [`Result`] is //! [`Err`] //! * [`map_or_else`] applies the provided function to the contained value -//! of [`Ok`], or applies the provided fallback function to the contained -//! value of [`Err`] +//! of [`Ok`], or applies the provided default fallback function to the +//! contained value of [`Err`] //! //! [`map_or`]: Result::map_or //! [`map_or_else`]: Result::map_or_else @@ -795,8 +795,8 @@ impl<T, E> Result<T, E> { } } - /// Maps a `Result<T, E>` to `U` by applying a fallback function to a - /// contained [`Err`] value, or a default function to a + /// 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. /// /// This function can be used to unpack a successful result |
