@@ -4283,10 +4283,7 @@ impl u8 {
42834283 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
42844284 #[ inline]
42854285 pub fn is_ascii_alphabetic ( & self ) -> bool {
4286- match * self {
4287- b'A' ..=b'Z' | b'a' ..=b'z' => true ,
4288- _ => false ,
4289- }
4286+ matches ! ( * self , b'A' ..=b'Z' | b'a' ..=b'z' )
42904287 }
42914288
42924289 /// Checks if the value is an ASCII uppercase character:
@@ -4318,10 +4315,7 @@ impl u8 {
43184315 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
43194316 #[ inline]
43204317 pub fn is_ascii_uppercase ( & self ) -> bool {
4321- match * self {
4322- b'A' ..=b'Z' => true ,
4323- _ => false ,
4324- }
4318+ matches ! ( * self , b'A' ..=b'Z' )
43254319 }
43264320
43274321 /// Checks if the value is an ASCII lowercase character:
@@ -4353,10 +4347,7 @@ impl u8 {
43534347 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
43544348 #[ inline]
43554349 pub fn is_ascii_lowercase ( & self ) -> bool {
4356- match * self {
4357- b'a' ..=b'z' => true ,
4358- _ => false ,
4359- }
4350+ matches ! ( * self , b'a' ..=b'z' )
43604351 }
43614352
43624353 /// Checks if the value is an ASCII alphanumeric character:
@@ -4391,10 +4382,7 @@ impl u8 {
43914382 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
43924383 #[ inline]
43934384 pub fn is_ascii_alphanumeric ( & self ) -> bool {
4394- match * self {
4395- b'0' ..=b'9' | b'A' ..=b'Z' | b'a' ..=b'z' => true ,
4396- _ => false ,
4397- }
4385+ matches ! ( * self , b'0' ..=b'9' | b'A' ..=b'Z' | b'a' ..=b'z' )
43984386 }
43994387
44004388 /// Checks if the value is an ASCII decimal digit:
@@ -4426,10 +4414,7 @@ impl u8 {
44264414 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
44274415 #[ inline]
44284416 pub fn is_ascii_digit ( & self ) -> bool {
4429- match * self {
4430- b'0' ..=b'9' => true ,
4431- _ => false ,
4432- }
4417+ matches ! ( * self , b'0' ..=b'9' )
44334418 }
44344419
44354420 /// Checks if the value is an ASCII hexadecimal digit:
@@ -4464,10 +4449,7 @@ impl u8 {
44644449 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
44654450 #[ inline]
44664451 pub fn is_ascii_hexdigit ( & self ) -> bool {
4467- match * self {
4468- b'0' ..=b'9' | b'A' ..=b'F' | b'a' ..=b'f' => true ,
4469- _ => false ,
4470- }
4452+ matches ! ( * self , b'0' ..=b'9' | b'A' ..=b'F' | b'a' ..=b'f' )
44714453 }
44724454
44734455 /// Checks if the value is an ASCII punctuation character:
@@ -4503,10 +4485,7 @@ impl u8 {
45034485 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
45044486 #[ inline]
45054487 pub fn is_ascii_punctuation ( & self ) -> bool {
4506- match * self {
4507- b'!' ..=b'/' | b':' ..=b'@' | b'[' ..=b'`' | b'{' ..=b'~' => true ,
4508- _ => false ,
4509- }
4488+ matches ! ( * self , b'!' ..=b'/' | b':' ..=b'@' | b'[' ..=b'`' | b'{' ..=b'~' )
45104489 }
45114490
45124491 /// Checks if the value is an ASCII graphic character:
@@ -4538,10 +4517,7 @@ impl u8 {
45384517 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
45394518 #[ inline]
45404519 pub fn is_ascii_graphic ( & self ) -> bool {
4541- match * self {
4542- b'!' ..=b'~' => true ,
4543- _ => false ,
4544- }
4520+ matches ! ( * self , b'!' ..=b'~' )
45454521 }
45464522
45474523 /// Checks if the value is an ASCII whitespace character:
@@ -4590,10 +4566,7 @@ impl u8 {
45904566 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
45914567 #[ inline]
45924568 pub fn is_ascii_whitespace ( & self ) -> bool {
4593- match * self {
4594- b'\t' | b'\n' | b'\x0C' | b'\r' | b' ' => true ,
4595- _ => false ,
4596- }
4569+ matches ! ( * self , b'\t' | b'\n' | b'\x0C' | b'\r' | b' ' )
45974570 }
45984571
45994572 /// Checks if the value is an ASCII control character:
@@ -4627,10 +4600,7 @@ impl u8 {
46274600 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
46284601 #[ inline]
46294602 pub fn is_ascii_control ( & self ) -> bool {
4630- match * self {
4631- b'\0' ..=b'\x1F' | b'\x7F' => true ,
4632- _ => false ,
4633- }
4603+ matches ! ( * self , b'\0' ..=b'\x1F' | b'\x7F' )
46344604 }
46354605}
46364606
0 commit comments