about summary refs log tree commit diff
diff options
context:
space:
mode:
authorHegui Dai <natural_selection_@outlook.com>2025-04-24 09:56:42 +0800
committerHegui Dai <natural_selection_@outlook.com>2025-04-24 09:56:42 +0800
commitf86cd705cbae4b155ff5e94f57cde637ec0ed7fa (patch)
tree746e4e55f433fecef3a680eb2ad05765055e583a
parentf8f23309ca0a77908b7d202bc5780059a86a47d9 (diff)
downloadrust-f86cd705cbae4b155ff5e94f57cde637ec0ed7fa.tar.gz
rust-f86cd705cbae4b155ff5e94f57cde637ec0ed7fa.zip
keep original text for is_ok and is_err
-rw-r--r--library/core/src/result.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/library/core/src/result.rs b/library/core/src/result.rs
index 1d3da72b05f..897ac206b8a 100644
--- a/library/core/src/result.rs
+++ b/library/core/src/result.rs
@@ -256,12 +256,12 @@
 //!
 //! ## Querying the variant
 //!
-//! The [`is_ok`] and [`is_err`] methods borrow of the [`Result`]
-//! and return [`true`] if the [`Result`] is [`Ok`] or [`Err`], respectively.
+//! The [`is_ok`] and [`is_err`] methods return [`true`] if the [`Result`]
+//! is [`Ok`] or [`Err`], respectively.
 //!
 //! The [`is_ok_and`] and [`is_err_and`] methods apply the provided function
-//! to the contents of the [`Result`] to produce a boolean value. If this is [`Err`]
-//! then a default result is returned instead without executing the function.
+//! to the contents of the [`Result`] to produce a boolean value. If the [`Result`]` does not have the expected variant
+//! then `false` is returned instead without executing the function.
 //!
 //! [`is_err`]: Result::is_err
 //! [`is_ok`]: Result::is_ok
@@ -347,9 +347,9 @@
 //! * [`map`] transforms [`Result<T, E>`] into [`Result<U, E>`] by applying
 //!   the provided function to the contained value of [`Ok`] and leaving
 //!   [`Err`] values unchanged
-//! * [`inspect`] takes ownership of the [`Result`] and applies the
+//! * [`inspect`] takes ownership of the [`Result`], applies the
 //!   provided function to the contained value by reference,
-//!   and then the [`Result`] is returned
+//!   and then returns the [`Result`]
 //!
 //! [`map`]: Result::map
 //! [`inspect`]: Result::inspect
@@ -359,9 +359,9 @@
 //! * [`map_err`] transforms [`Result<T, E>`] into [`Result<T, F>`] by
 //!   applying the provided function to the contained value of [`Err`] and
 //!   leaving [`Ok`] values unchanged
-//! * [`inspect_err`] takes ownership of the [`Result`] and applies the
+//! * [`inspect_err`] takes ownership of the [`Result`], applies the
 //!   provided function to the contained value of [`Err`] by reference,
-//!   and then the [`Result`] is returned
+//!   and then returns the [`Result`]
 //!
 //! [`map_err`]: Result::map_err
 //! [`inspect_err`]: Result::inspect_err