diff options
| author | Trevor Gross <t.gross35@gmail.com> | 2025-02-24 18:46:35 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-24 18:46:35 -0500 |
| commit | 57ce16ca275eb263c0cf1b934ab61666e6e17230 (patch) | |
| tree | 0dc75f253c0dc7828cbab7a71e9b9f9e5a053227 /library/alloc/src/vec/mod.rs | |
| parent | 03326daf23ea67499e0a67fa2db871650faf5348 (diff) | |
| parent | c39f33baae94665d69a45d45a00d0dc028c80cc9 (diff) | |
| download | rust-57ce16ca275eb263c0cf1b934ab61666e6e17230.tar.gz rust-57ce16ca275eb263c0cf1b934ab61666e6e17230.zip | |
Rollup merge of #137109 - bend-n:knife, r=oli-obk
stabilize extract_if Tracking issue: #43244 Closes: #43244 FCP completed: https://github.com/rust-lang/rust/issues/43244#issuecomment-2523595704
Diffstat (limited to 'library/alloc/src/vec/mod.rs')
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index 9822237764a..701144cc3af 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -66,7 +66,7 @@ use core::ptr::{self, NonNull}; use core::slice::{self, SliceIndex}; use core::{fmt, intrinsics}; -#[unstable(feature = "extract_if", reason = "recently added", issue = "43244")] +#[stable(feature = "extract_if", since = "CURRENT_RUSTC_VERSION")] pub use self::extract_if::ExtractIf; use crate::alloc::{Allocator, Global}; use crate::borrow::{Cow, ToOwned}; @@ -3696,7 +3696,6 @@ impl<T, A: Allocator> Vec<T, A> { /// Splitting an array into evens and odds, reusing the original allocation: /// /// ``` - /// #![feature(extract_if)] /// let mut numbers = vec![1, 2, 3, 4, 5, 6, 8, 9, 11, 13, 14, 15]; /// /// let evens = numbers.extract_if(.., |x| *x % 2 == 0).collect::<Vec<_>>(); @@ -3709,13 +3708,12 @@ impl<T, A: Allocator> Vec<T, A> { /// Using the range argument to only process a part of the vector: /// /// ``` - /// #![feature(extract_if)] /// let mut items = vec![0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 2, 1, 2]; /// let ones = items.extract_if(7.., |x| *x == 1).collect::<Vec<_>>(); /// assert_eq!(items, vec![0, 0, 0, 0, 0, 0, 0, 2, 2, 2]); /// assert_eq!(ones.len(), 3); /// ``` - #[unstable(feature = "extract_if", reason = "recently added", issue = "43244")] + #[stable(feature = "extract_if", since = "CURRENT_RUSTC_VERSION")] pub fn extract_if<F, R>(&mut self, range: R, filter: F) -> ExtractIf<'_, T, F, A> where F: FnMut(&mut T) -> bool, |
