|
256 | 256 | //!
|
257 | 257 | //! ## Querying the variant
|
258 | 258 | //!
|
259 |
| -//! The [`is_ok`] and [`is_err`] methods borrow of the [`Result`] |
260 |
| -//! and return [`true`] if the [`Result`] is [`Ok`] or [`Err`], respectively. |
| 259 | +//! The [`is_ok`] and [`is_err`] methods return [`true`] if the [`Result`] |
| 260 | +//! is [`Ok`] or [`Err`], respectively. |
261 | 261 | //!
|
262 | 262 | //! The [`is_ok_and`] and [`is_err_and`] methods apply the provided function
|
263 |
| -//! to the contents of the [`Result`] to produce a boolean value. If this is [`Err`] |
264 |
| -//! then a default result is returned instead without executing the function. |
| 263 | +//! to the contents of the [`Result`] to produce a boolean value. If the [`Result`]` does not have the expected variant |
| 264 | +//! then `false` is returned instead without executing the function. |
265 | 265 | //!
|
266 | 266 | //! [`is_err`]: Result::is_err
|
267 | 267 | //! [`is_ok`]: Result::is_ok
|
|
347 | 347 | //! * [`map`] transforms [`Result<T, E>`] into [`Result<U, E>`] by applying
|
348 | 348 | //! the provided function to the contained value of [`Ok`] and leaving
|
349 | 349 | //! [`Err`] values unchanged
|
350 |
| -//! * [`inspect`] takes ownership of the [`Result`] and applies the |
| 350 | +//! * [`inspect`] takes ownership of the [`Result`], applies the |
351 | 351 | //! provided function to the contained value by reference,
|
352 |
| -//! and then the [`Result`] is returned |
| 352 | +//! and then returns the [`Result`] |
353 | 353 | //!
|
354 | 354 | //! [`map`]: Result::map
|
355 | 355 | //! [`inspect`]: Result::inspect
|
|
359 | 359 | //! * [`map_err`] transforms [`Result<T, E>`] into [`Result<T, F>`] by
|
360 | 360 | //! applying the provided function to the contained value of [`Err`] and
|
361 | 361 | //! leaving [`Ok`] values unchanged
|
362 |
| -//! * [`inspect_err`] takes ownership of the [`Result`] and applies the |
| 362 | +//! * [`inspect_err`] takes ownership of the [`Result`], applies the |
363 | 363 | //! provided function to the contained value of [`Err`] by reference,
|
364 |
| -//! and then the [`Result`] is returned |
| 364 | +//! and then returns the [`Result`] |
365 | 365 | //!
|
366 | 366 | //! [`map_err`]: Result::map_err
|
367 | 367 | //! [`inspect_err`]: Result::inspect_err
|
|
0 commit comments