@@ -1416,6 +1416,7 @@ $EndFeature, "
14161416```" ) ,
14171417 #[ stable( feature = "no_panic_abs" , since = "1.13.0" ) ]
14181418 #[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
1419+ #[ allow( unused_attributes) ]
14191420 #[ allow_internal_unstable( const_if_match) ]
14201421 #[ inline]
14211422 pub const fn wrapping_abs( self ) -> Self {
@@ -1709,6 +1710,7 @@ assert_eq!(", stringify!($SelfT), "::MIN.overflowing_neg(), (", stringify!($Self
17091710 #[ inline]
17101711 #[ stable( feature = "wrapping" , since = "1.7.0" ) ]
17111712 #[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
1713+ #[ allow( unused_attributes) ]
17121714 #[ allow_internal_unstable( const_if_match) ]
17131715 pub const fn overflowing_neg( self ) -> ( Self , bool ) {
17141716 if self == Self :: min_value( ) {
@@ -1997,6 +1999,7 @@ $EndFeature, "
19971999```" ) ,
19982000 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
19992001 #[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
2002+ #[ allow( unused_attributes) ]
20002003 #[ allow_internal_unstable( const_if_match) ]
20012004 #[ inline]
20022005 #[ rustc_inherit_overflow_checks]
@@ -4283,10 +4286,7 @@ impl u8 {
42834286 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
42844287 #[ inline]
42854288 pub fn is_ascii_alphabetic ( & self ) -> bool {
4286- match * self {
4287- b'A' ..=b'Z' | b'a' ..=b'z' => true ,
4288- _ => false ,
4289- }
4289+ matches ! ( * self , b'A' ..=b'Z' | b'a' ..=b'z' )
42904290 }
42914291
42924292 /// Checks if the value is an ASCII uppercase character:
@@ -4318,10 +4318,7 @@ impl u8 {
43184318 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
43194319 #[ inline]
43204320 pub fn is_ascii_uppercase ( & self ) -> bool {
4321- match * self {
4322- b'A' ..=b'Z' => true ,
4323- _ => false ,
4324- }
4321+ matches ! ( * self , b'A' ..=b'Z' )
43254322 }
43264323
43274324 /// Checks if the value is an ASCII lowercase character:
@@ -4353,10 +4350,7 @@ impl u8 {
43534350 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
43544351 #[ inline]
43554352 pub fn is_ascii_lowercase ( & self ) -> bool {
4356- match * self {
4357- b'a' ..=b'z' => true ,
4358- _ => false ,
4359- }
4353+ matches ! ( * self , b'a' ..=b'z' )
43604354 }
43614355
43624356 /// Checks if the value is an ASCII alphanumeric character:
@@ -4391,10 +4385,7 @@ impl u8 {
43914385 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
43924386 #[ inline]
43934387 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- }
4388+ matches ! ( * self , b'0' ..=b'9' | b'A' ..=b'Z' | b'a' ..=b'z' )
43984389 }
43994390
44004391 /// Checks if the value is an ASCII decimal digit:
@@ -4426,10 +4417,7 @@ impl u8 {
44264417 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
44274418 #[ inline]
44284419 pub fn is_ascii_digit ( & self ) -> bool {
4429- match * self {
4430- b'0' ..=b'9' => true ,
4431- _ => false ,
4432- }
4420+ matches ! ( * self , b'0' ..=b'9' )
44334421 }
44344422
44354423 /// Checks if the value is an ASCII hexadecimal digit:
@@ -4464,10 +4452,7 @@ impl u8 {
44644452 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
44654453 #[ inline]
44664454 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- }
4455+ matches ! ( * self , b'0' ..=b'9' | b'A' ..=b'F' | b'a' ..=b'f' )
44714456 }
44724457
44734458 /// Checks if the value is an ASCII punctuation character:
@@ -4503,10 +4488,7 @@ impl u8 {
45034488 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
45044489 #[ inline]
45054490 pub fn is_ascii_punctuation ( & self ) -> bool {
4506- match * self {
4507- b'!' ..=b'/' | b':' ..=b'@' | b'[' ..=b'`' | b'{' ..=b'~' => true ,
4508- _ => false ,
4509- }
4491+ matches ! ( * self , b'!' ..=b'/' | b':' ..=b'@' | b'[' ..=b'`' | b'{' ..=b'~' )
45104492 }
45114493
45124494 /// Checks if the value is an ASCII graphic character:
@@ -4538,10 +4520,7 @@ impl u8 {
45384520 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
45394521 #[ inline]
45404522 pub fn is_ascii_graphic ( & self ) -> bool {
4541- match * self {
4542- b'!' ..=b'~' => true ,
4543- _ => false ,
4544- }
4523+ matches ! ( * self , b'!' ..=b'~' )
45454524 }
45464525
45474526 /// Checks if the value is an ASCII whitespace character:
@@ -4590,10 +4569,7 @@ impl u8 {
45904569 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
45914570 #[ inline]
45924571 pub fn is_ascii_whitespace ( & self ) -> bool {
4593- match * self {
4594- b'\t' | b'\n' | b'\x0C' | b'\r' | b' ' => true ,
4595- _ => false ,
4596- }
4572+ matches ! ( * self , b'\t' | b'\n' | b'\x0C' | b'\r' | b' ' )
45974573 }
45984574
45994575 /// Checks if the value is an ASCII control character:
@@ -4627,10 +4603,7 @@ impl u8 {
46274603 #[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
46284604 #[ inline]
46294605 pub fn is_ascii_control ( & self ) -> bool {
4630- match * self {
4631- b'\0' ..=b'\x1F' | b'\x7F' => true ,
4632- _ => false ,
4633- }
4606+ matches ! ( * self , b'\0' ..=b'\x1F' | b'\x7F' )
46344607 }
46354608}
46364609
0 commit comments