Mark several ascii methods as unstable again
We don't want to stabilize them now already. The goal of this set of commits is just to add inherent methods to the four types. Stabilizing all of those methods can be done later.
This commit is contained in:
parent
da57580736
commit
259c125267
8 changed files with 88 additions and 40 deletions
|
@ -2205,7 +2205,7 @@ impl str {
|
|||
///
|
||||
/// - U+0041 'A' ... U+005A 'Z', or
|
||||
/// - U+0061 'a' ... U+007A 'z'.
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
|
||||
#[unstable(feature = "ascii_ctype", issue = "39658")]
|
||||
#[inline]
|
||||
pub fn is_ascii_alphabetic(&self) -> bool {
|
||||
self.bytes().all(|b| b.is_ascii_alphabetic())
|
||||
|
@ -2217,6 +2217,8 @@ impl str {
|
|||
/// # Example
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(ascii_ctype)]
|
||||
///
|
||||
/// // Only ascii uppercase characters
|
||||
/// assert!("HELLO".is_ascii_uppercase());
|
||||
///
|
||||
|
@ -2226,7 +2228,7 @@ impl str {
|
|||
/// // While all characters are uppercase, 'Ü' is not ascii
|
||||
/// assert!(!"TSCHÜSS".is_ascii_uppercase());
|
||||
/// ```
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
|
||||
#[unstable(feature = "ascii_ctype", issue = "39658")]
|
||||
#[inline]
|
||||
pub fn is_ascii_uppercase(&self) -> bool {
|
||||
self.bytes().all(|b| b.is_ascii_uppercase())
|
||||
|
@ -2238,6 +2240,8 @@ impl str {
|
|||
/// # Example
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(ascii_ctype)]
|
||||
///
|
||||
/// // Only ascii uppercase characters
|
||||
/// assert!("hello".is_ascii_lowercase());
|
||||
///
|
||||
|
@ -2247,7 +2251,7 @@ impl str {
|
|||
/// // While all characters are lowercase, 'Ü' is not ascii
|
||||
/// assert!(!"tschüss".is_ascii_lowercase());
|
||||
/// ```
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
|
||||
#[unstable(feature = "ascii_ctype", issue = "39658")]
|
||||
#[inline]
|
||||
pub fn is_ascii_lowercase(&self) -> bool {
|
||||
self.bytes().all(|b| b.is_ascii_lowercase())
|
||||
|
@ -2259,7 +2263,7 @@ impl str {
|
|||
/// - U+0041 'A' ... U+005A 'Z', or
|
||||
/// - U+0061 'a' ... U+007A 'z', or
|
||||
/// - U+0030 '0' ... U+0039 '9'.
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
|
||||
#[unstable(feature = "ascii_ctype", issue = "39658")]
|
||||
#[inline]
|
||||
pub fn is_ascii_alphanumeric(&self) -> bool {
|
||||
self.bytes().all(|b| b.is_ascii_alphanumeric())
|
||||
|
@ -2267,7 +2271,7 @@ impl str {
|
|||
|
||||
/// Checks if all characters of this string are ASCII decimal digit:
|
||||
/// U+0030 '0' ... U+0039 '9'.
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
|
||||
#[unstable(feature = "ascii_ctype", issue = "39658")]
|
||||
#[inline]
|
||||
pub fn is_ascii_digit(&self) -> bool {
|
||||
self.bytes().all(|b| b.is_ascii_digit())
|
||||
|
@ -2278,7 +2282,7 @@ impl str {
|
|||
/// - U+0030 '0' ... U+0039 '9', or
|
||||
/// - U+0041 'A' ... U+0046 'F', or
|
||||
/// - U+0061 'a' ... U+0066 'f'.
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
|
||||
#[unstable(feature = "ascii_ctype", issue = "39658")]
|
||||
#[inline]
|
||||
pub fn is_ascii_hexdigit(&self) -> bool {
|
||||
self.bytes().all(|b| b.is_ascii_hexdigit())
|
||||
|
@ -2291,7 +2295,7 @@ impl str {
|
|||
/// - U+003A ... U+0040 `: ; < = > ? @`, or
|
||||
/// - U+005B ... U+0060 `[ \\ ] ^ _ \``, or
|
||||
/// - U+007B ... U+007E `{ | } ~`
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
|
||||
#[unstable(feature = "ascii_ctype", issue = "39658")]
|
||||
#[inline]
|
||||
pub fn is_ascii_punctuation(&self) -> bool {
|
||||
self.bytes().all(|b| b.is_ascii_punctuation())
|
||||
|
@ -2299,7 +2303,7 @@ impl str {
|
|||
|
||||
/// Checks if all characters of this string are ASCII graphic characters:
|
||||
/// U+0021 '@' ... U+007E '~'.
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
|
||||
#[unstable(feature = "ascii_ctype", issue = "39658")]
|
||||
#[inline]
|
||||
pub fn is_ascii_graphic(&self) -> bool {
|
||||
self.bytes().all(|b| b.is_ascii_graphic())
|
||||
|
@ -2324,7 +2328,7 @@ impl str {
|
|||
/// [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
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
|
||||
#[unstable(feature = "ascii_ctype", issue = "39658")]
|
||||
#[inline]
|
||||
pub fn is_ascii_whitespace(&self) -> bool {
|
||||
self.bytes().all(|b| b.is_ascii_whitespace())
|
||||
|
@ -2337,7 +2341,7 @@ impl str {
|
|||
///
|
||||
/// Note that most ASCII whitespace characters are control
|
||||
/// characters, but SPACE is not.
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
|
||||
#[unstable(feature = "ascii_ctype", issue = "39658")]
|
||||
#[inline]
|
||||
pub fn is_ascii_control(&self) -> bool {
|
||||
self.bytes().all(|b| b.is_ascii_control())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue