Skip to content

Commit

Permalink
Improve wording of map_or_else docs
Browse files Browse the repository at this point in the history
Changes doc text to refer to the "default" parameter as the "default"
function.
  • Loading branch information
Nitepone committed Sep 30, 2021
1 parent c6007fd commit 35b0015
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions library/core/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 35b0015

Please sign in to comment.