@@ -742,8 +742,9 @@ impl char {
742
742
#[ inline]
743
743
pub fn is_alphabetic ( self ) -> bool {
744
744
match self {
745
- 'a' ..='z' | 'A' ..='Z' => true ,
746
- c => c > '\x7f' && unicode:: Alphabetic ( c) ,
745
+ 'A' ..='Z' | 'a' ..='z' => true ,
746
+ '\0' ..='\u{A9}' => false ,
747
+ _ => unicode:: Alphabetic ( self ) ,
747
748
}
748
749
}
749
750
@@ -785,7 +786,8 @@ impl char {
785
786
pub const fn is_lowercase ( self ) -> bool {
786
787
match self {
787
788
'a' ..='z' => true ,
788
- c => c > '\x7f' && unicode:: Lowercase ( c) ,
789
+ '\0' ..='\u{A9}' => false ,
790
+ _ => unicode:: Lowercase ( self ) ,
789
791
}
790
792
}
791
793
@@ -827,7 +829,8 @@ impl char {
827
829
pub const fn is_uppercase ( self ) -> bool {
828
830
match self {
829
831
'A' ..='Z' => true ,
830
- c => c > '\x7f' && unicode:: Uppercase ( c) ,
832
+ '\0' ..='\u{BF}' => false ,
833
+ _ => unicode:: Uppercase ( self ) ,
831
834
}
832
835
}
833
836
@@ -859,7 +862,8 @@ impl char {
859
862
pub fn is_whitespace ( self ) -> bool {
860
863
match self {
861
864
' ' | '\x09' ..='\x0d' => true ,
862
- c => c > '\x7f' && unicode:: White_Space ( c) ,
865
+ '\0' ..='\u{84}' => false ,
866
+ _ => unicode:: White_Space ( self ) ,
863
867
}
864
868
}
865
869
@@ -927,7 +931,7 @@ impl char {
927
931
#[ must_use]
928
932
#[ inline]
929
933
pub ( crate ) fn is_grapheme_extended ( self ) -> bool {
930
- self > '\x7f ' && unicode:: Grapheme_Extend ( self )
934
+ self > '\u{02FF} ' && unicode:: Grapheme_Extend ( self )
931
935
}
932
936
933
937
/// Returns `true` if this `char` has one of the general categories for numbers.
@@ -969,7 +973,8 @@ impl char {
969
973
pub fn is_numeric ( self ) -> bool {
970
974
match self {
971
975
'0' ..='9' => true ,
972
- c => c > '\x7f' && unicode:: N ( c) ,
976
+ '\0' ..='\u{B1}' => false ,
977
+ _ => unicode:: N ( self ) ,
973
978
}
974
979
}
975
980
0 commit comments