mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-26 13:01:27 +03:00
Tweak is_ascii_punctuation()/graphic() docs wording
The `_punctuation` methods return `true` for characters with Unicode general category of punctuation (P), but also for those with general category of symbol (S).
This commit is contained in:
@@ -949,7 +949,8 @@ pub const fn is_hexdigit(self) -> bool {
|
||||
self.to_u8().is_ascii_hexdigit()
|
||||
}
|
||||
|
||||
/// Checks if the value is a punctuation character:
|
||||
/// Checks if the value is a punctuation or symbol character
|
||||
/// (i.e. not alphanumeric, whitespace, or control):
|
||||
///
|
||||
/// - 0x21 ..= 0x2F `! " # $ % & ' ( ) * + , - . /`, or
|
||||
/// - 0x3A ..= 0x40 `: ; < = > ? @`, or
|
||||
@@ -989,7 +990,8 @@ pub const fn is_punctuation(self) -> bool {
|
||||
self.to_u8().is_ascii_punctuation()
|
||||
}
|
||||
|
||||
/// Checks if the value is a graphic character:
|
||||
/// Checks if the value is a graphic character
|
||||
/// (i.e. not whitespace or control):
|
||||
/// 0x21 '!' ..= 0x7E '~'.
|
||||
///
|
||||
/// # Examples
|
||||
|
||||
@@ -1984,7 +1984,8 @@ pub const fn is_ascii_hexdigit(&self) -> bool {
|
||||
matches!(*self, '0'..='9') | matches!(*self, 'A'..='F') | matches!(*self, 'a'..='f')
|
||||
}
|
||||
|
||||
/// Checks if the value is an ASCII punctuation character:
|
||||
/// Checks if the value is an ASCII punctuation or symbol character
|
||||
/// (i.e. not alphanumeric, whitespace, or control):
|
||||
///
|
||||
/// - U+0021 ..= U+002F `! " # $ % & ' ( ) * + , - . /`, or
|
||||
/// - U+003A ..= U+0040 `: ; < = > ? @`, or
|
||||
@@ -2025,7 +2026,8 @@ pub const fn is_ascii_punctuation(&self) -> bool {
|
||||
| matches!(*self, '{'..='~')
|
||||
}
|
||||
|
||||
/// Checks if the value is an ASCII graphic character:
|
||||
/// Checks if the value is an ASCII graphic character
|
||||
/// (i.e. not whitespace or control):
|
||||
/// U+0021 '!' ..= U+007E '~'.
|
||||
///
|
||||
/// # Examples
|
||||
|
||||
@@ -986,7 +986,8 @@ pub const fn is_ascii_hexdigit(&self) -> bool {
|
||||
matches!(*self, b'0'..=b'9') | matches!(*self, b'A'..=b'F') | matches!(*self, b'a'..=b'f')
|
||||
}
|
||||
|
||||
/// Checks if the value is an ASCII punctuation character:
|
||||
/// Checks if the value is an ASCII punctuation or symbol character
|
||||
/// (i.e. not alphanumeric, whitespace, or control):
|
||||
///
|
||||
/// - U+0021 ..= U+002F `! " # $ % & ' ( ) * + , - . /`, or
|
||||
/// - U+003A ..= U+0040 `: ; < = > ? @`, or
|
||||
@@ -1027,7 +1028,8 @@ pub const fn is_ascii_punctuation(&self) -> bool {
|
||||
| matches!(*self, b'{'..=b'~')
|
||||
}
|
||||
|
||||
/// Checks if the value is an ASCII graphic character:
|
||||
/// Checks if the value is an ASCII graphic character
|
||||
/// (i.e. not whitespace or control):
|
||||
/// U+0021 '!' ..= U+007E '~'.
|
||||
///
|
||||
/// # Examples
|
||||
|
||||
Reference in New Issue
Block a user