about summary refs log tree commit diff
path: root/src/liballoc/slice.rs
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2017-11-29 18:37:44 +0800
committerGitHub <noreply@github.com>2017-11-29 18:37:44 +0800
commit963ab91dd40a57c061229f006dcf8ce271d89664 (patch)
tree40c0aaa5494f132492f7fb1fdc94cec54723f612 /src/liballoc/slice.rs
parent0ec3aee569a8a34117d265e48eb980a955a2186d (diff)
parentc5aad96739228e8e05b597b32ee7126c843b7228 (diff)
downloadrust-963ab91dd40a57c061229f006dcf8ce271d89664.tar.gz
rust-963ab91dd40a57c061229f006dcf8ce271d89664.zip
Rollup merge of #46077 - LukasKalbertodt:stabilize-ascii-ctype, r=alexcrichton
Stabilize some `ascii_ctype` methods

As discussed in #39658, this PR stabilizes those methods for `u8` and `char`. All inherent `ascii_ctype` for `[u8]` and `str` are removed as we prefer the more explicit version `s.chars().all(|c| c.is_ascii_())`.

This PR doesn't modify the `AsciiExt` trait. There, the `ascii_ctype` methods are still unstable. It is planned to remove those in the future (I think). I had to modify some code in `ascii.rs` to properly implement `AsciiExt` for all types.

Fixes #39658.
Diffstat (limited to 'src/liballoc/slice.rs')
-rw-r--r--src/liballoc/slice.rs114
1 files changed, 0 insertions, 114 deletions
diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs
index 7e3d2af79ce..499608e3ea8 100644
--- a/src/liballoc/slice.rs
+++ b/src/liballoc/slice.rs
@@ -1626,120 +1626,6 @@ impl [u8] {
             byte.make_ascii_lowercase();
         }
     }
-
-    /// Checks if all bytes of this slice are ASCII alphabetic characters:
-    ///
-    /// - U+0041 'A' ... U+005A 'Z', or
-    /// - U+0061 'a' ... U+007A 'z'.
-    #[unstable(feature = "ascii_ctype", issue = "39658")]
-    #[inline]
-    pub fn is_ascii_alphabetic(&self) -> bool {
-        self.iter().all(|b| b.is_ascii_alphabetic())
-    }
-
-    /// Checks if all bytes of this slice are ASCII uppercase characters:
-    /// U+0041 'A' ... U+005A 'Z'.
-    #[unstable(feature = "ascii_ctype", issue = "39658")]
-    #[inline]
-    pub fn is_ascii_uppercase(&self) -> bool {
-        self.iter().all(|b| b.is_ascii_uppercase())
-    }
-
-    /// Checks if all bytes of this slice are ASCII lowercase characters:
-    /// U+0061 'a' ... U+007A 'z'.
-    #[unstable(feature = "ascii_ctype", issue = "39658")]
-    #[inline]
-    pub fn is_ascii_lowercase(&self) -> bool {
-        self.iter().all(|b| b.is_ascii_lowercase())
-    }
-
-    /// Checks if all bytes of this slice are ASCII alphanumeric characters:
-    ///
-    /// - U+0041 'A' ... U+005A 'Z', or
-    /// - U+0061 'a' ... U+007A 'z', or
-    /// - U+0030 '0' ... U+0039 '9'.
-    #[unstable(feature = "ascii_ctype", issue = "39658")]
-    #[inline]
-    pub fn is_ascii_alphanumeric(&self) -> bool {
-        self.iter().all(|b| b.is_ascii_alphanumeric())
-    }
-
-    /// Checks if all bytes of this slice are ASCII decimal digit:
-    /// U+0030 '0' ... U+0039 '9'.
-    #[unstable(feature = "ascii_ctype", issue = "39658")]
-    #[inline]
-    pub fn is_ascii_digit(&self) -> bool {
-        self.iter().all(|b| b.is_ascii_digit())
-    }
-
-    /// Checks if all bytes of this slice are ASCII hexadecimal digits:
-    ///
-    /// - U+0030 '0' ... U+0039 '9', or
-    /// - U+0041 'A' ... U+0046 'F', or
-    /// - U+0061 'a' ... U+0066 'f'.
-    #[unstable(feature = "ascii_ctype", issue = "39658")]
-    #[inline]
-    pub fn is_ascii_hexdigit(&self) -> bool {
-        self.iter().all(|b| b.is_ascii_hexdigit())
-    }
-
-    /// Checks if all bytes of this slice are ASCII punctuation characters:
-    ///
-    /// - U+0021 ... U+002F `! " # $ % & ' ( ) * + , - . /`, or
-    /// - U+003A ... U+0040 `: ; < = > ? @`, or
-    /// - U+005B ... U+0060 `[ \\ ] ^ _ \``, or
-    /// - U+007B ... U+007E `{ | } ~`
-    #[unstable(feature = "ascii_ctype", issue = "39658")]
-    #[inline]
-    pub fn is_ascii_punctuation(&self) -> bool {
-        self.iter().all(|b| b.is_ascii_punctuation())
-    }
-
-    /// Checks if all bytes of this slice are ASCII graphic characters:
-    /// U+0021 '@' ... U+007E '~'.
-    #[unstable(feature = "ascii_ctype", issue = "39658")]
-    #[inline]
-    pub fn is_ascii_graphic(&self) -> bool {
-        self.iter().all(|b| b.is_ascii_graphic())
-    }
-
-    /// Checks if all bytes of this slice are ASCII whitespace characters:
-    /// U+0020 SPACE, U+0009 HORIZONTAL TAB, U+000A LINE FEED,
-    /// U+000C FORM FEED, or U+000D CARRIAGE RETURN.
-    ///
-    /// Rust uses the WhatWG Infra Standard's [definition of ASCII
-    /// whitespace][infra-aw]. There are several other definitions in
-    /// wide use. For instance, [the POSIX locale][pct] includes
-    /// U+000B VERTICAL TAB as well as all the above characters,
-    /// but—from the very same specification—[the default rule for
-    /// "field splitting" in the Bourne shell][bfs] considers *only*
-    /// SPACE, HORIZONTAL TAB, and LINE FEED as whitespace.
-    ///
-    /// If you are writing a program that will process an existing
-    /// file format, check what that format's definition of whitespace is
-    /// before using this function.
-    ///
-    /// [infra-aw]: https://infra.spec.whatwg.org/#ascii-whitespace
-    /// [pct]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_01
-    /// [bfs]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_05
-    #[unstable(feature = "ascii_ctype", issue = "39658")]
-    #[inline]
-    pub fn is_ascii_whitespace(&self) -> bool {
-        self.iter().all(|b| b.is_ascii_whitespace())
-    }
-
-    /// Checks if all bytes of this slice are ASCII control characters:
-    ///
-    /// - U+0000 NUL ... U+001F UNIT SEPARATOR, or
-    /// - U+007F DELETE.
-    ///
-    /// Note that most ASCII whitespace characters are control
-    /// characters, but SPACE is not.
-    #[unstable(feature = "ascii_ctype", issue = "39658")]
-    #[inline]
-    pub fn is_ascii_control(&self) -> bool {
-        self.iter().all(|b| b.is_ascii_control())
-    }
 }
 
 ////////////////////////////////////////////////////////////////////////////////