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`
This commit is contained in:
Matthias Krüger 2023-06-04 13:21:25 +02:00 committed by GitHub
commit 7ee2505529
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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>