Skip to content

Commit 7fb34c9

Browse files
authored
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`
1 parent cf8d98b commit 7fb34c9

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
@@ -1464,6 +1464,7 @@ impl<T> Option<T> {
14641464
/// let item_2_0 = arr_2d.get(2).and_then(|row| row.get(0));
14651465
/// assert_eq!(item_2_0, None);
14661466
/// ```
1467+
#[doc(alias = "flatmap")]
14671468
#[inline]
14681469
#[stable(feature = "rust1", since = "1.0.0")]
14691470
#[rustc_const_unstable(feature = "const_option_ext", issue = "91930")]

0 commit comments

Comments
 (0)