diff --git a/src/liballoc/btree/map.rs b/src/liballoc/btree/map.rs index c604df7049e0c..d59cef874a166 100644 --- a/src/liballoc/btree/map.rs +++ b/src/liballoc/btree/map.rs @@ -2156,8 +2156,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(self, mut f: F) -> Self - where F: FnMut(&mut V) + pub fn and_modify(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 d5ef41df0d850..14d5e96d2e73a 100644 --- a/src/liballoc/str.rs +++ b/src/liballoc/str.rs @@ -2122,48 +2122,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 { - UnicodeStr::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 { - UnicodeStr::is_alphanumeric(self) - } - /// Checks if all characters in this string are within the ASCII range. /// /// # Examples diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs index ab11b0d62e9f7..0ef3934b5f60d 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -422,7 +422,7 @@ fn partition_source(s: &str) -> (String, String) { for line in s.lines() { let trimline = line.trim(); - let header = trimline.is_whitespace() || + let header = trimline.chars().all(|c| c.is_whitespace()) || trimline.starts_with("#![") || trimline.starts_with("#[macro_use] extern crate") || trimline.starts_with("extern crate"); diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index 452fa4e471c69..4322392dca37d 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -2204,8 +2204,8 @@ impl<'a, K, V> Entry<'a, K, V> { /// assert_eq!(map["poneyland"], 43); /// ``` #[stable(feature = "entry_and_modify", since = "1.26.0")] - pub fn and_modify(self, mut f: F) -> Self - where F: FnMut(&mut V) + pub fn and_modify(self, f: F) -> Self + where F: FnOnce(&mut V) { match self { Occupied(mut entry) => {