From 7fb34c99e32c01082110dc7281049e26622f924d Mon Sep 17 00:00:00 2001 From: Dante Broggi <34220985+Dante-Broggi@users.noreply.github.com> Date: Mon, 13 Mar 2023 15:52:32 -0400 Subject: [PATCH] add `#[doc(alias="flatmap")]` to `Option::and_then` I keep forgetting that rust calls this `and_then` and trying to search for `flatmap`. `and_then`'s docs even mention "Some languages call this operation flatmap", but it doesn't show up as a result in the search at `https://doc.rust-lang.org/std/?search=flatmap` --- library/core/src/option.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/core/src/option.rs b/library/core/src/option.rs index 0f2475a8bde..b5ea8916275 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -1464,6 +1464,7 @@ impl Option { /// let item_2_0 = arr_2d.get(2).and_then(|row| row.get(0)); /// assert_eq!(item_2_0, None); /// ``` + #[doc(alias = "flatmap")] #[inline] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")]