about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-06-04 13:21:25 +0200
committerGitHub <noreply@github.com>2023-06-04 13:21:25 +0200
commit7ee25055299830804b9714bbb5fdd36fb9d74ba9 (patch)
treeb098257bce95a1607c83889624a4d379fe49dddc
parent9eee230cd0a56bfba3ce65121798d9f9f4341cdd (diff)
parent7fb34c99e32c01082110dc7281049e26622f924d (diff)
downloadrust-7ee25055299830804b9714bbb5fdd36fb9d74ba9.tar.gz
rust-7ee25055299830804b9714bbb5fdd36fb9d74ba9.zip
Rollup merge of #109093 - Dante-Broggi:patch-2, r=joshtriplett
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`
-rw-r--r--library/core/src/option.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/core/src/option.rs b/library/core/src/option.rs
index b93b40e3003..9b6ff76b240 100644
--- a/library/core/src/option.rs
+++ b/library/core/src/option.rs
@@ -1402,6 +1402,7 @@ impl<T> Option<T> {
     /// 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")]
     pub fn and_then<U, F>(self, f: F) -> Option<U>