diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2018-04-19 15:52:14 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2018-04-19 16:53:12 -0700 |
| commit | ca79ba300a0934864d6ea520f9424d5f08ece687 (patch) | |
| tree | 1d44ca6449c4b2a3950d4358e6d61043ba6db0e5 /src/liballoc | |
| parent | 65d201f7d682ad921ac6e67ac07f922aa63a8ce4 (diff) | |
| download | rust-ca79ba300a0934864d6ea520f9424d5f08ece687.tar.gz rust-ca79ba300a0934864d6ea520f9424d5f08ece687.zip | |
Tweak some stabilizations in libstd
This commit tweaks a few stable APIs in the `beta` branch before they hit stable. The `str::is_whitespace` and `str::is_alphanumeric` functions were deleted (added in #49381, issue at #49657). The `and_modify` APIs added in #44734 were altered to take a `FnOnce` closure rather than a `FnMut` closure. Closes #49581 Closes #49657
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/btree/map.rs | 4 | ||||
| -rw-r--r-- | src/liballoc/str.rs | 42 |
2 files changed, 2 insertions, 44 deletions
diff --git a/src/liballoc/btree/map.rs b/src/liballoc/btree/map.rs index 82cbec0517e..3984379ea86 100644 --- a/src/liballoc/btree/map.rs +++ b/src/liballoc/btree/map.rs @@ -2155,8 +2155,8 @@ impl<'a, K: Ord, V> Entry<'a, K, V> { /// assert_eq!(map["poneyland"], 43); /// ``` #[stable(feature = "entry_and_modify", since = "1.26.0")] - pub fn and_modify<F>(self, mut f: F) -> Self - where F: FnMut(&mut V) + pub fn and_modify<F>(self, f: F) -> Self + where F: FnOnce(&mut V) { match self { Occupied(mut entry) => { diff --git a/src/liballoc/str.rs b/src/liballoc/str.rs index 0e708465332..686a0408a7c 100644 --- a/src/liballoc/str.rs +++ b/src/liballoc/str.rs @@ -2140,48 +2140,6 @@ impl str { unsafe { String::from_utf8_unchecked(buf) } } - /// Returns true if this `str` is entirely whitespace, and false otherwise. - /// - /// 'Whitespace' is defined according to the terms of the Unicode Derived Core - /// Property `White_Space`. - /// - /// # Examples - /// - /// Basic usage: - /// - /// ``` - /// assert!(" \t ".is_whitespace()); - /// - /// // a non-breaking space - /// assert!("\u{A0}".is_whitespace()); - /// - /// assert!(!" 越".is_whitespace()); - /// ``` - #[stable(feature = "unicode_methods_on_intrinsics", since = "1.27.0")] - #[inline] - pub fn is_whitespace(&self) -> bool { - StrExt::is_whitespace(self) - } - - /// Returns true if this `str` is entirely alphanumeric, and false otherwise. - /// - /// 'Alphanumeric'-ness is defined in terms of the Unicode General Categories - /// 'Nd', 'Nl', 'No' and the Derived Core Property 'Alphabetic'. - /// - /// # Examples - /// - /// Basic usage: - /// - /// ``` - /// assert!("٣7৬Kو藏".is_alphanumeric()); - /// assert!(!"¾①".is_alphanumeric()); - /// ``` - #[stable(feature = "unicode_methods_on_intrinsics", since = "1.27.0")] - #[inline] - pub fn is_alphanumeric(&self) -> bool { - StrExt::is_alphanumeric(self) - } - /// Checks if all characters in this string are within the ASCII range. /// /// # Examples |
