diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2024-02-14 16:04:40 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2024-02-22 18:05:28 +0000 |
| commit | f566867ace85044ef80f73cf9c214876a5aa4e77 (patch) | |
| tree | 5dc0af56f2551366bfbfa190baba071d56398990 | |
| parent | caa216d2451e669a8efd1e2ef19b57fb010fde75 (diff) | |
| download | rust-f566867ace85044ef80f73cf9c214876a5aa4e77.tar.gz rust-f566867ace85044ef80f73cf9c214876a5aa4e77.zip | |
Add `flatmap`/`flat_map` -> `and_then` suggestions
| -rw-r--r-- | library/core/src/option.rs | 1 | ||||
| -rw-r--r-- | library/core/src/result.rs | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/library/core/src/option.rs b/library/core/src/option.rs index 0e5eb03239c..53c9ae498c0 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -1403,6 +1403,7 @@ impl<T> Option<T> { #[doc(alias = "flatmap")] #[inline] #[stable(feature = "rust1", since = "1.0.0")] + #[rustc_confusables("flat_map", "flatmap")] pub fn and_then<U, F>(self, f: F) -> Option<U> where F: FnOnce(T) -> Option<U>, diff --git a/library/core/src/result.rs b/library/core/src/result.rs index 80f7fe75e82..6879ac03f70 100644 --- a/library/core/src/result.rs +++ b/library/core/src/result.rs @@ -1315,6 +1315,7 @@ impl<T, E> Result<T, E> { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] + #[rustc_confusables("flat_map", "flatmap")] pub fn and_then<U, F: FnOnce(T) -> Result<U, E>>(self, op: F) -> Result<U, E> { match self { Ok(t) => op(t), |
