@@ -4286,10 +4286,7 @@ impl u8 {
42864286 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
42874287 #[ inline]
42884288 pub fn is_ascii_alphabetic ( & self ) -> bool {
4289- match * self {
4290- b'A' ..=b'Z' | b'a' ..=b'z' => true ,
4291- _ => false ,
4292- }
4289+ matches ! ( * self , b'A' ..=b'Z' | b'a' ..=b'z' )
42934290 }
42944291
42954292 /// Checks if the value is an ASCII uppercase character:
@@ -4321,10 +4318,7 @@ impl u8 {
43214318 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
43224319 #[ inline]
43234320 pub fn is_ascii_uppercase ( & self ) -> bool {
4324- match * self {
4325- b'A' ..=b'Z' => true ,
4326- _ => false ,
4327- }
4321+ matches ! ( * self , b'A' ..=b'Z' )
43284322 }
43294323
43304324 /// Checks if the value is an ASCII lowercase character:
@@ -4356,10 +4350,7 @@ impl u8 {
43564350 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
43574351 #[ inline]
43584352 pub fn is_ascii_lowercase ( & self ) -> bool {
4359- match * self {
4360- b'a' ..=b'z' => true ,
4361- _ => false ,
4362- }
4353+ matches ! ( * self , b'a' ..=b'z' )
43634354 }
43644355
43654356 /// Checks if the value is an ASCII alphanumeric character:
@@ -4394,10 +4385,7 @@ impl u8 {
43944385 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
43954386 #[ inline]
43964387 pub fn is_ascii_alphanumeric ( & self ) -> bool {
4397- match * self {
4398- b'0' ..=b'9' | b'A' ..=b'Z' | b'a' ..=b'z' => true ,
4399- _ => false ,
4400- }
4388+ matches ! ( * self , b'0' ..=b'9' | b'A' ..=b'Z' | b'a' ..=b'z' )
44014389 }
44024390
44034391 /// Checks if the value is an ASCII decimal digit:
@@ -4429,10 +4417,7 @@ impl u8 {
44294417 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
44304418 #[ inline]
44314419 pub fn is_ascii_digit ( & self ) -> bool {
4432- match * self {
4433- b'0' ..=b'9' => true ,
4434- _ => false ,
4435- }
4420+ matches ! ( * self , b'0' ..=b'9' )
44364421 }
44374422
44384423 /// Checks if the value is an ASCII hexadecimal digit:
@@ -4467,10 +4452,7 @@ impl u8 {
44674452 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
44684453 #[ inline]
44694454 pub fn is_ascii_hexdigit ( & self ) -> bool {
4470- match * self {
4471- b'0' ..=b'9' | b'A' ..=b'F' | b'a' ..=b'f' => true ,
4472- _ => false ,
4473- }
4455+ matches ! ( * self , b'0' ..=b'9' | b'A' ..=b'F' | b'a' ..=b'f' )
44744456 }
44754457
44764458 /// Checks if the value is an ASCII punctuation character:
@@ -4506,10 +4488,7 @@ impl u8 {
45064488 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
45074489 #[ inline]
45084490 pub fn is_ascii_punctuation ( & self ) -> bool {
4509- match * self {
4510- b'!' ..=b'/' | b':' ..=b'@' | b'[' ..=b'`' | b'{' ..=b'~' => true ,
4511- _ => false ,
4512- }
4491+ matches ! ( * self , b'!' ..=b'/' | b':' ..=b'@' | b'[' ..=b'`' | b'{' ..=b'~' )
45134492 }
45144493
45154494 /// Checks if the value is an ASCII graphic character:
@@ -4541,10 +4520,7 @@ impl u8 {
45414520 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
45424521 #[ inline]
45434522 pub fn is_ascii_graphic ( & self ) -> bool {
4544- match * self {
4545- b'!' ..=b'~' => true ,
4546- _ => false ,
4547- }
4523+ matches ! ( * self , b'!' ..=b'~' )
45484524 }
45494525
45504526 /// Checks if the value is an ASCII whitespace character:
@@ -4593,10 +4569,7 @@ impl u8 {
45934569 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
45944570 #[ inline]
45954571 pub fn is_ascii_whitespace ( & self ) -> bool {
4596- match * self {
4597- b'\t' | b'\n' | b'\x0C' | b'\r' | b' ' => true ,
4598- _ => false ,
4599- }
4572+ matches ! ( * self , b'\t' | b'\n' | b'\x0C' | b'\r' | b' ' )
46004573 }
46014574
46024575 /// Checks if the value is an ASCII control character:
@@ -4630,10 +4603,7 @@ impl u8 {
46304603 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
46314604 #[ inline]
46324605 pub fn is_ascii_control ( & self ) -> bool {
4633- match * self {
4634- b'\0' ..=b'\x1F' | b'\x7F' => true ,
4635- _ => false ,
4636- }
4606+ matches ! ( * self , b'\0' ..=b'\x1F' | b'\x7F' )
46374607 }
46384608}
46394609
0 commit comments