@@ -1229,10 +1229,7 @@ impl char {
1229
1229
#[ rustc_const_stable( feature = "const_ascii_ctype_on_intrinsics" , since = "1.47.0" ) ]
1230
1230
#[ inline]
1231
1231
pub const fn is_ascii_alphabetic ( & self ) -> bool {
1232
- match * self {
1233
- 'A' ..='Z' | 'a' ..='z' => true ,
1234
- _ => false ,
1235
- }
1232
+ matches ! ( * self , 'A' ..='Z' | 'a' ..='z' )
1236
1233
}
1237
1234
1238
1235
/// Checks if the value is an ASCII uppercase character:
@@ -1265,10 +1262,7 @@ impl char {
1265
1262
#[ rustc_const_stable( feature = "const_ascii_ctype_on_intrinsics" , since = "1.47.0" ) ]
1266
1263
#[ inline]
1267
1264
pub const fn is_ascii_uppercase ( & self ) -> bool {
1268
- match * self {
1269
- 'A' ..='Z' => true ,
1270
- _ => false ,
1271
- }
1265
+ matches ! ( * self , 'A' ..='Z' )
1272
1266
}
1273
1267
1274
1268
/// Checks if the value is an ASCII lowercase character:
@@ -1301,10 +1295,7 @@ impl char {
1301
1295
#[ rustc_const_stable( feature = "const_ascii_ctype_on_intrinsics" , since = "1.47.0" ) ]
1302
1296
#[ inline]
1303
1297
pub const fn is_ascii_lowercase ( & self ) -> bool {
1304
- match * self {
1305
- 'a' ..='z' => true ,
1306
- _ => false ,
1307
- }
1298
+ matches ! ( * self , 'a' ..='z' )
1308
1299
}
1309
1300
1310
1301
/// Checks if the value is an ASCII alphanumeric character:
@@ -1340,10 +1331,7 @@ impl char {
1340
1331
#[ rustc_const_stable( feature = "const_ascii_ctype_on_intrinsics" , since = "1.47.0" ) ]
1341
1332
#[ inline]
1342
1333
pub const fn is_ascii_alphanumeric ( & self ) -> bool {
1343
- match * self {
1344
- '0' ..='9' | 'A' ..='Z' | 'a' ..='z' => true ,
1345
- _ => false ,
1346
- }
1334
+ matches ! ( * self , '0' ..='9' | 'A' ..='Z' | 'a' ..='z' )
1347
1335
}
1348
1336
1349
1337
/// Checks if the value is an ASCII decimal digit:
@@ -1376,10 +1364,7 @@ impl char {
1376
1364
#[ rustc_const_stable( feature = "const_ascii_ctype_on_intrinsics" , since = "1.47.0" ) ]
1377
1365
#[ inline]
1378
1366
pub const fn is_ascii_digit ( & self ) -> bool {
1379
- match * self {
1380
- '0' ..='9' => true ,
1381
- _ => false ,
1382
- }
1367
+ matches ! ( * self , '0' ..='9' )
1383
1368
}
1384
1369
1385
1370
/// Checks if the value is an ASCII hexadecimal digit:
@@ -1415,10 +1400,7 @@ impl char {
1415
1400
#[ rustc_const_stable( feature = "const_ascii_ctype_on_intrinsics" , since = "1.47.0" ) ]
1416
1401
#[ inline]
1417
1402
pub const fn is_ascii_hexdigit ( & self ) -> bool {
1418
- match * self {
1419
- '0' ..='9' | 'A' ..='F' | 'a' ..='f' => true ,
1420
- _ => false ,
1421
- }
1403
+ matches ! ( * self , '0' ..='9' | 'A' ..='F' | 'a' ..='f' )
1422
1404
}
1423
1405
1424
1406
/// Checks if the value is an ASCII punctuation character:
@@ -1455,10 +1437,7 @@ impl char {
1455
1437
#[ rustc_const_stable( feature = "const_ascii_ctype_on_intrinsics" , since = "1.47.0" ) ]
1456
1438
#[ inline]
1457
1439
pub const fn is_ascii_punctuation ( & self ) -> bool {
1458
- match * self {
1459
- '!' ..='/' | ':' ..='@' | '[' ..='`' | '{' ..='~' => true ,
1460
- _ => false ,
1461
- }
1440
+ matches ! ( * self , '!' ..='/' | ':' ..='@' | '[' ..='`' | '{' ..='~' )
1462
1441
}
1463
1442
1464
1443
/// Checks if the value is an ASCII graphic character:
@@ -1491,10 +1470,7 @@ impl char {
1491
1470
#[ rustc_const_stable( feature = "const_ascii_ctype_on_intrinsics" , since = "1.47.0" ) ]
1492
1471
#[ inline]
1493
1472
pub const fn is_ascii_graphic ( & self ) -> bool {
1494
- match * self {
1495
- '!' ..='~' => true ,
1496
- _ => false ,
1497
- }
1473
+ matches ! ( * self , '!' ..='~' )
1498
1474
}
1499
1475
1500
1476
/// Checks if the value is an ASCII whitespace character:
@@ -1544,10 +1520,7 @@ impl char {
1544
1520
#[ rustc_const_stable( feature = "const_ascii_ctype_on_intrinsics" , since = "1.47.0" ) ]
1545
1521
#[ inline]
1546
1522
pub const fn is_ascii_whitespace ( & self ) -> bool {
1547
- match * self {
1548
- '\t' | '\n' | '\x0C' | '\r' | ' ' => true ,
1549
- _ => false ,
1550
- }
1523
+ matches ! ( * self , '\t' | '\n' | '\x0C' | '\r' | ' ' )
1551
1524
}
1552
1525
1553
1526
/// Checks if the value is an ASCII control character:
@@ -1582,10 +1555,7 @@ impl char {
1582
1555
#[ rustc_const_stable( feature = "const_ascii_ctype_on_intrinsics" , since = "1.47.0" ) ]
1583
1556
#[ inline]
1584
1557
pub const fn is_ascii_control ( & self ) -> bool {
1585
- match * self {
1586
- '\0' ..='\x1F' | '\x7F' => true ,
1587
- _ => false ,
1588
- }
1558
+ matches ! ( * self , '\0' ..='\x1F' | '\x7F' )
1589
1559
}
1590
1560
}
1591
1561
0 commit comments