From 370f731dfb6e3fecadd210e3393e38de8503ab8e Mon Sep 17 00:00:00 2001 From: Taylor Yu Date: Fri, 11 Jun 2021 12:47:37 -0500 Subject: [PATCH] more transformation methods in option overview --- library/core/src/option.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/core/src/option.rs b/library/core/src/option.rs index a2abfe658bd6..c1b9517658a5 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -143,6 +143,8 @@ //! //! ## Transforming contained values //! +//! * [`flatten`] removes one level of nesting from an +//! [`Option>`] //! * [`map`] transforms [`Some`] to [`Some`] using the provided //! function //! * [`map_or`] transforms [`Some`] to a value of `U` using the @@ -155,8 +157,11 @@ //! [`Err(err)`] using the provided default `err` value //! * [`ok_or_else`] transforms [`Some(v)`] to [`Ok(v)`], and [`None`] to //! a value of [`Err`] using the provided function +//! * [`transpose`] transposes an [`Option`] of a [`Result`] into a +//! [`Result`] of an [`Option`] //! //! [`Err(err)`]: Err +//! [`flatten`]: Option::flatten //! [`map`]: Option::map //! [`map_or`]: Option::map_or //! [`map_or_else`]: Option::map_or_else @@ -164,6 +169,7 @@ //! [`ok_or`]: Option::ok_or //! [`ok_or_else`]: Option::ok_or_else //! [`Some(v)`]: Some +//! [`transpose`]: Option::transpose //! //! ## Boolean operators //!