diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-07-16 19:54:04 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-16 19:54:04 +0200 |
| commit | 7c5cabe30f4c6402e06ab0240cdfc066e7c70e8e (patch) | |
| tree | 686a87f05af69dd7d1414d5a9a7ea4dd1f663b91 /library/core/src/array | |
| parent | effea681c03389482b98c1b5901c842fc94befde (diff) | |
| parent | 7fc4fc747c90d800989dbe06ec6c5e12661a1f59 (diff) | |
| download | rust-7c5cabe30f4c6402e06ab0240cdfc066e7c70e8e.tar.gz rust-7c5cabe30f4c6402e06ab0240cdfc066e7c70e8e.zip | |
Rollup merge of #87174 - inquisitivecrystal:array-map, r=kennytm
Stabilize `[T; N]::map()` This stabilizes the `[T; N]::map()` function, gated by the `array_map` feature. The FCP has [already completed.](https://github.com/rust-lang/rust/issues/75243#issuecomment-878448138) Closes #75243.
Diffstat (limited to 'library/core/src/array')
| -rw-r--r-- | library/core/src/array/mod.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index 32d344010aa..78b799cd709 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -296,7 +296,6 @@ impl<T, const N: usize> [T; N] { /// # Examples /// /// ``` - /// #![feature(array_map)] /// let x = [1, 2, 3]; /// let y = x.map(|v| v + 1); /// assert_eq!(y, [2, 3, 4]); @@ -310,7 +309,7 @@ impl<T, const N: usize> [T; N] { /// let y = x.map(|v| v.len()); /// assert_eq!(y, [6, 9, 3, 3]); /// ``` - #[unstable(feature = "array_map", issue = "75243")] + #[stable(feature = "array_map", since = "1.55.0")] pub fn map<F, U>(self, f: F) -> [U; N] where F: FnMut(T) -> U, @@ -377,7 +376,7 @@ impl<T, const N: usize> [T; N] { /// array if its elements are not `Copy`. /// /// ``` - /// #![feature(array_methods, array_map)] + /// #![feature(array_methods)] /// /// let strings = ["Ferris".to_string(), "♥".to_string(), "Rust".to_string()]; /// let is_ascii = strings.each_ref().map(|s| s.is_ascii()); |
