Skip to content

Commit e84bbc9

Browse files
authored
Rollup merge of rust-lang#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`
2 parents 9eee230 + 7fb34c9 commit e84bbc9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/core/src/option.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1402,6 +1402,7 @@ impl<T> Option<T> {
14021402
/// let item_2_0 = arr_2d.get(2).and_then(|row| row.get(0));
14031403
/// assert_eq!(item_2_0, None);
14041404
/// ```
1405+
#[doc(alias = "flatmap")]
14051406
#[inline]
14061407
#[stable(feature = "rust1", since = "1.0.0")]
14071408
pub fn and_then<U, F>(self, f: F) -> Option<U>

0 commit comments

Comments
 (0)