diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2017-07-20 15:42:14 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2017-07-25 07:09:31 -0700 |
| commit | 46de2af063f976b8b3ac174ee6a0636863fe6a4a (patch) | |
| tree | 5f6af22eea5cf6c083359db454713613d77ee310 /src/liballoc/str.rs | |
| parent | 64c1b233742d3b1ab016160c05beadc42dc10340 (diff) | |
| download | rust-46de2af063f976b8b3ac174ee6a0636863fe6a4a.tar.gz rust-46de2af063f976b8b3ac174ee6a0636863fe6a4a.zip | |
std: Stabilize `str_checked_slicing` feature
Stabilized * `<str>::get` * `<str>::get_mut` * `<str>::get_unchecked` * `<str>::get_unchecked_mut` Closes #39932
Diffstat (limited to 'src/liballoc/str.rs')
| -rw-r--r-- | src/liballoc/str.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/liballoc/str.rs b/src/liballoc/str.rs index f56288c3013..e4953988c5c 100644 --- a/src/liballoc/str.rs +++ b/src/liballoc/str.rs @@ -328,14 +328,13 @@ impl str { /// # Examples /// /// ``` - /// # #![feature(str_checked_slicing)] /// let v = "🗻∈🌏"; /// assert_eq!(Some("🗻"), v.get(0..4)); /// assert!(v.get(1..).is_none()); /// assert!(v.get(..8).is_none()); /// assert!(v.get(..42).is_none()); /// ``` - #[unstable(feature = "str_checked_slicing", issue = "39932")] + #[stable(feature = "str_checked_slicing", since = "1.20.0")] #[inline] pub fn get<I: SliceIndex<str>>(&self, i: I) -> Option<&I::Output> { core_str::StrExt::get(self, i) @@ -351,14 +350,13 @@ impl str { /// # Examples /// /// ``` - /// # #![feature(str_checked_slicing)] /// let mut v = String::from("🗻∈🌏"); /// assert_eq!(Some("🗻"), v.get_mut(0..4).map(|v| &*v)); /// assert!(v.get_mut(1..).is_none()); /// assert!(v.get_mut(..8).is_none()); /// assert!(v.get_mut(..42).is_none()); /// ``` - #[unstable(feature = "str_checked_slicing", issue = "39932")] + #[stable(feature = "str_checked_slicing", since = "1.20.0")] #[inline] pub fn get_mut<I: SliceIndex<str>>(&mut self, i: I) -> Option<&mut I::Output> { core_str::StrExt::get_mut(self, i) @@ -383,7 +381,6 @@ impl str { /// # Examples /// /// ``` - /// # #![feature(str_checked_slicing)] /// let v = "🗻∈🌏"; /// unsafe { /// assert_eq!("🗻", v.get_unchecked(0..4)); @@ -391,7 +388,7 @@ impl str { /// assert_eq!("🌏", v.get_unchecked(7..11)); /// } /// ``` - #[unstable(feature = "str_checked_slicing", issue = "39932")] + #[stable(feature = "str_checked_slicing", since = "1.20.0")] #[inline] pub unsafe fn get_unchecked<I: SliceIndex<str>>(&self, i: I) -> &I::Output { core_str::StrExt::get_unchecked(self, i) @@ -416,7 +413,6 @@ impl str { /// # Examples /// /// ``` - /// # #![feature(str_checked_slicing)] /// let mut v = String::from("🗻∈🌏"); /// unsafe { /// assert_eq!("🗻", v.get_unchecked_mut(0..4)); @@ -424,7 +420,7 @@ impl str { /// assert_eq!("🌏", v.get_unchecked_mut(7..11)); /// } /// ``` - #[unstable(feature = "str_checked_slicing", issue = "39932")] + #[stable(feature = "str_checked_slicing", since = "1.20.0")] #[inline] pub unsafe fn get_unchecked_mut<I: SliceIndex<str>>(&mut self, i: I) -> &mut I::Output { core_str::StrExt::get_unchecked_mut(self, i) |
