diff --git a/library/core/src/option.rs b/library/core/src/option.rs index ee755f6629e5..a1f0224c7791 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -171,6 +171,13 @@ //! [`is_some_and`]: Option::is_some_and //! [`is_none_or`]: Option::is_none_or //! +//! ## Inspecting the variant +//! +//! The [`inspect`] method takes ownership of the [`Option`] +//! and applies the provided function to the contained value by reference if [`Some`] +//! +//! [`inspect`]: Option::inspect +//! //! ## Adapters for working with references //! //! * [`as_ref`] converts from [&][][Option]\ to [Option]<[&]T> @@ -248,8 +255,6 @@ //! if the function returns `true`; otherwise, returns [`None`] //! * [`flatten`] removes one level of nesting from an //! [`Option>`] -//! * [`insert`] calls the provided function with a reference to -//! the contained value if [`Some`] //! * [`map`] transforms [`Option`] to [`Option`] by applying the //! provided function to the contained value of [`Some`] and leaving //! [`None`] values unchanged @@ -257,7 +262,6 @@ //! [`Some(t)`]: Some //! [`filter`]: Option::filter //! [`flatten`]: Option::flatten -//! [`insert`]: Option::insert //! [`map`]: Option::map //! //! These methods transform [`Option`] to a value of a possibly