Skip to content

Commit 0401446

Browse files
committed
more transformation methods in option overview
1 parent 20a0062 commit 0401446

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/src/option.rs

+6
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@
143143
//!
144144
//! ## Transforming contained values
145145
//!
146+
//! * [`flatten`] removes one level of nesting from an
147+
//! [`Option<Option<T>>`]
146148
//! * [`map`] transforms [`Some<T>`] to [`Some<U>`] using the provided
147149
//! function
148150
//! * [`map_or`] transforms [`Some<T>`] to a value of `U` using the
@@ -155,15 +157,19 @@
155157
//! [`Err(err)`] using the provided default `err` value
156158
//! * [`ok_or_else`] transforms [`Some(v)`] to [`Ok(v)`], and [`None`] to
157159
//! a value of [`Err<E>`] using the provided function
160+
//! * [`transpose`] transposes an [`Option`] of a [`Result`] into a
161+
//! [`Result`] of an [`Option`]
158162
//!
159163
//! [`Err(err)`]: Err
164+
//! [`flatten`]: Option::flatten
160165
//! [`map`]: Option::map
161166
//! [`map_or`]: Option::map_or
162167
//! [`map_or_else`]: Option::map_or_else
163168
//! [`Ok(v)`]: Ok
164169
//! [`ok_or`]: Option::ok_or
165170
//! [`ok_or_else`]: Option::ok_or_else
166171
//! [`Some(v)`]: Some
172+
//! [`transpose`]: Option::transpose
167173
//!
168174
//! ## Boolean operators
169175
//!

0 commit comments

Comments
 (0)