Skip to content

Commit f566867

Browse files
committed
Add flatmap/flat_map -> and_then suggestions
1 parent caa216d commit f566867

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

library/core/src/option.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1403,6 +1403,7 @@ impl<T> Option<T> {
14031403
#[doc(alias = "flatmap")]
14041404
#[inline]
14051405
#[stable(feature = "rust1", since = "1.0.0")]
1406+
#[rustc_confusables("flat_map", "flatmap")]
14061407
pub fn and_then<U, F>(self, f: F) -> Option<U>
14071408
where
14081409
F: FnOnce(T) -> Option<U>,

library/core/src/result.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1315,6 +1315,7 @@ impl<T, E> Result<T, E> {
13151315
/// ```
13161316
#[inline]
13171317
#[stable(feature = "rust1", since = "1.0.0")]
1318+
#[rustc_confusables("flat_map", "flatmap")]
13181319
pub fn and_then<U, F: FnOnce(T) -> Result<U, E>>(self, op: F) -> Result<U, E> {
13191320
match self {
13201321
Ok(t) => op(t),

0 commit comments

Comments
 (0)