Skip to content

Commit 159ae8f

Browse files
Keeps the inspect() classification the same as in Result
1 parent fc126df commit 159ae8f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

library/core/src/option.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,13 @@
171171
//! [`is_some_and`]: Option::is_some_and
172172
//! [`is_none_or`]: Option::is_none_or
173173
//!
174+
//! ## Inspecting the variant
175+
//!
176+
//! The [`inspect`] method takes ownership of the [`Option`]
177+
//! and applies the provided function to the contained value by reference if [`Some`]
178+
//!
179+
//! [`inspect`]: Option::inspect
180+
//!
174181
//! ## Adapters for working with references
175182
//!
176183
//! * [`as_ref`] converts from <code>[&][][Option]\<T></code> to <code>[Option]<[&]T></code>
@@ -248,16 +255,13 @@
248255
//! if the function returns `true`; otherwise, returns [`None`]
249256
//! * [`flatten`] removes one level of nesting from an
250257
//! [`Option<Option<T>>`]
251-
//! * [`insert`] calls the provided function with a reference to
252-
//! the contained value if [`Some`]
253258
//! * [`map`] transforms [`Option<T>`] to [`Option<U>`] by applying the
254259
//! provided function to the contained value of [`Some`] and leaving
255260
//! [`None`] values unchanged
256261
//!
257262
//! [`Some(t)`]: Some
258263
//! [`filter`]: Option::filter
259264
//! [`flatten`]: Option::flatten
260-
//! [`insert`]: Option::insert
261265
//! [`map`]: Option::map
262266
//!
263267
//! These methods transform [`Option<T>`] to a value of a possibly

0 commit comments

Comments
 (0)