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:
commit
7ee2505529
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user