Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions library/core/src/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,8 @@ impl<T> Option<T> {
}
}

/// Applies a function to the contained value (if any),
/// or returns the provided default (if not).
/// Returns the provided default result (if none),
/// or applies a function to the contained value (if any).
///
/// Arguments passed to `map_or` are eagerly evaluated; if you are passing
/// the result of a function call, it is recommended to use [`map_or_else`],
Expand All @@ -516,8 +516,8 @@ impl<T> Option<T> {
}
}

/// Applies a function to the contained value (if any),
/// or computes a default (if not).
/// Computes a default function result (if none), or
/// applies a different function to the contained value (if any).
///
/// # Examples
///
Expand Down
10 changes: 5 additions & 5 deletions library/core/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,8 @@ impl<T, E> Result<T, E> {
}
}

/// Applies a function to the contained value (if [`Ok`]),
/// or returns the provided default (if [`Err`]).
/// Returns the provided default (if [`Err`]), or
/// applies a function to the contained value (if [`Ok`]),
///
/// Arguments passed to `map_or` are eagerly evaluated; if you are passing
/// the result of a function call, it is recommended to use [`map_or_else`],
Expand All @@ -533,9 +533,9 @@ impl<T, E> Result<T, E> {
}
}

/// Maps a `Result<T, E>` to `U` by applying a function to a
/// contained [`Ok`] value, or a fallback function to a
/// contained [`Err`] value.
/// Maps a `Result<T, E>` to `U` by applying a fallback function to a
/// contained [`Err`] value, or a default function to a
/// contained [`Ok`] value.
///
/// This function can be used to unpack a successful result
/// while handling an error.
Expand Down