diff options
Diffstat (limited to 'src/libcore/char.rs')
| -rw-r--r-- | src/libcore/char.rs | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/libcore/char.rs b/src/libcore/char.rs index c07a31490c3..8af61dcb861 100644 --- a/src/libcore/char.rs +++ b/src/libcore/char.rs @@ -100,12 +100,6 @@ pub fn is_alphanumeric(c: char) -> bool { unicode::general_category::No(c); } -/// Indicates whether the character is an ASCII character -#[inline(always)] -pub fn is_ascii(c: char) -> bool { - c - ('\x7F' & c) == '\x00' -} - /// Indicates whether the character is numeric (Nd, Nl, or No) #[inline(always)] pub fn is_digit(c: char) -> bool { @@ -116,7 +110,7 @@ pub fn is_digit(c: char) -> bool { /** * Checks if a character parses as a numeric digit in the given radix. - * Compared to `is_digit()`, this function only recognizes the ascii + * Compared to `is_digit()`, this function only recognizes the * characters `0-9`, `a-z` and `A-Z`. * * Returns `true` if `c` is a valid digit under `radix`, and `false` @@ -163,7 +157,7 @@ pub fn to_digit(c: char, radix: uint) -> Option<uint> { } /** - * Converts a number to the ascii character representing it. + * Converts a number to the character representing it. * * Returns `Some(char)` if `num` represents one digit under `radix`, * using one character of `0-9` or `a-z`, or `None` if it doesn't. @@ -317,12 +311,6 @@ fn test_to_digit() { } #[test] -fn test_is_ascii() { - assert!(str::all(~"banana", is_ascii)); - assert!(! str::all(~"ประเทศไทย中华Việt Nam", is_ascii)); -} - -#[test] fn test_is_digit() { assert!(is_digit('2')); assert!(is_digit('7')); |
