From 0ab4250373663ae089ede8cbe8f3c5b74e1f7f34 Mon Sep 17 00:00:00 2001 From: wr7 Date: Mon, 19 May 2025 18:34:48 -0600 Subject: [PATCH] Stabilize `substr_range` and related methods --- library/core/src/slice/mod.rs | 4 +--- library/core/src/str/mod.rs | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index 1bca13b14ed4c..e0b2caa0f2873 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -4870,8 +4870,6 @@ impl [T] { /// # Examples /// Basic usage: /// ``` - /// #![feature(substr_range)] - /// /// let nums = &[0, 5, 10, 0, 0, 5]; /// /// let mut iter = nums @@ -4884,7 +4882,7 @@ impl [T] { /// assert_eq!(iter.next(), Some(5..6)); /// ``` #[must_use] - #[unstable(feature = "substr_range", issue = "126769")] + #[stable(feature = "substr_range", since = "CURRENT_RUSTC_VERSION")] pub fn subslice_range(&self, subslice: &[T]) -> Option> { if T::IS_ZST { panic!("elements are zero-sized"); diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs index ab7389a1300c5..e2b406078aa69 100644 --- a/library/core/src/str/mod.rs +++ b/library/core/src/str/mod.rs @@ -3099,8 +3099,6 @@ impl str { /// /// # Examples /// ``` - /// #![feature(substr_range)] - /// /// let data = "a, b, b, a"; /// let mut iter = data.split(", ").map(|s| data.substr_range(s).unwrap()); /// @@ -3110,7 +3108,7 @@ impl str { /// assert_eq!(iter.next(), Some(9..10)); /// ``` #[must_use] - #[unstable(feature = "substr_range", issue = "126769")] + #[stable(feature = "substr_range", since = "CURRENT_RUSTC_VERSION")] pub fn substr_range(&self, substr: &str) -> Option> { self.as_bytes().subslice_range(substr.as_bytes()) }