Skip to content

Commit 9e387cf

Browse files
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.
2 parents 19d9a14 + 35b0015 commit 9e387cf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/core/src/result.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@
329329
//! [`Ok`], or returns the provided default value if the [`Result`] is
330330
//! [`Err`]
331331
//! * [`map_or_else`] applies the provided function to the contained value
332-
//! of [`Ok`], or applies the provided fallback function to the contained
333-
//! value of [`Err`]
332+
//! of [`Ok`], or applies the provided default fallback function to the
333+
//! contained value of [`Err`]
334334
//!
335335
//! [`map_or`]: Result::map_or
336336
//! [`map_or_else`]: Result::map_or_else
@@ -795,8 +795,8 @@ impl<T, E> Result<T, E> {
795795
}
796796
}
797797

798-
/// Maps a `Result<T, E>` to `U` by applying a fallback function to a
799-
/// contained [`Err`] value, or a default function to a
798+
/// Maps a `Result<T, E>` to `U` by applying a provided default fallback
799+
/// function to a contained [`Err`] value, or a provided function to a
800800
/// contained [`Ok`] value.
801801
///
802802
/// This function can be used to unpack a successful result

0 commit comments

Comments
 (0)