@@ -1416,6 +1416,7 @@ $EndFeature, "
1416
1416
```" ) ,
1417
1417
#[ stable( feature = "no_panic_abs" , since = "1.13.0" ) ]
1418
1418
#[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
1419
+ #[ allow( unused_attributes) ]
1419
1420
#[ allow_internal_unstable( const_if_match) ]
1420
1421
#[ inline]
1421
1422
pub const fn wrapping_abs( self ) -> Self {
@@ -1709,6 +1710,7 @@ assert_eq!(", stringify!($SelfT), "::MIN.overflowing_neg(), (", stringify!($Self
1709
1710
#[ inline]
1710
1711
#[ stable( feature = "wrapping" , since = "1.7.0" ) ]
1711
1712
#[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
1713
+ #[ allow( unused_attributes) ]
1712
1714
#[ allow_internal_unstable( const_if_match) ]
1713
1715
pub const fn overflowing_neg( self ) -> ( Self , bool ) {
1714
1716
if self == Self :: min_value( ) {
@@ -1997,6 +1999,7 @@ $EndFeature, "
1997
1999
```" ) ,
1998
2000
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1999
2001
#[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
2002
+ #[ allow( unused_attributes) ]
2000
2003
#[ allow_internal_unstable( const_if_match) ]
2001
2004
#[ inline]
2002
2005
#[ rustc_inherit_overflow_checks]
@@ -4283,10 +4286,7 @@ impl u8 {
4283
4286
#[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
4284
4287
#[ inline]
4285
4288
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' )
4290
4290
}
4291
4291
4292
4292
/// Checks if the value is an ASCII uppercase character:
@@ -4318,10 +4318,7 @@ impl u8 {
4318
4318
#[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
4319
4319
#[ inline]
4320
4320
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' )
4325
4322
}
4326
4323
4327
4324
/// Checks if the value is an ASCII lowercase character:
@@ -4353,10 +4350,7 @@ impl u8 {
4353
4350
#[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
4354
4351
#[ inline]
4355
4352
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' )
4360
4354
}
4361
4355
4362
4356
/// Checks if the value is an ASCII alphanumeric character:
@@ -4391,10 +4385,7 @@ impl u8 {
4391
4385
#[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
4392
4386
#[ inline]
4393
4387
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' )
4398
4389
}
4399
4390
4400
4391
/// Checks if the value is an ASCII decimal digit:
@@ -4426,10 +4417,7 @@ impl u8 {
4426
4417
#[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
4427
4418
#[ inline]
4428
4419
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' )
4433
4421
}
4434
4422
4435
4423
/// Checks if the value is an ASCII hexadecimal digit:
@@ -4464,10 +4452,7 @@ impl u8 {
4464
4452
#[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
4465
4453
#[ inline]
4466
4454
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' )
4471
4456
}
4472
4457
4473
4458
/// Checks if the value is an ASCII punctuation character:
@@ -4503,10 +4488,7 @@ impl u8 {
4503
4488
#[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
4504
4489
#[ inline]
4505
4490
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'~' )
4510
4492
}
4511
4493
4512
4494
/// Checks if the value is an ASCII graphic character:
@@ -4538,10 +4520,7 @@ impl u8 {
4538
4520
#[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
4539
4521
#[ inline]
4540
4522
pub fn is_ascii_graphic ( & self ) -> bool {
4541
- match * self {
4542
- b'!' ..=b'~' => true ,
4543
- _ => false ,
4544
- }
4523
+ matches ! ( * self , b'!' ..=b'~' )
4545
4524
}
4546
4525
4547
4526
/// Checks if the value is an ASCII whitespace character:
@@ -4590,10 +4569,7 @@ impl u8 {
4590
4569
#[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
4591
4570
#[ inline]
4592
4571
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' ' )
4597
4573
}
4598
4574
4599
4575
/// Checks if the value is an ASCII control character:
@@ -4627,10 +4603,7 @@ impl u8 {
4627
4603
#[ stable( feature = "ascii_ctype_on_intrinsics" , since = "1.24.0" ) ]
4628
4604
#[ inline]
4629
4605
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' )
4634
4607
}
4635
4608
}
4636
4609
0 commit comments