@@ -404,7 +404,8 @@ impl AsciiChar {
404
404
/// Check if the character is a letter (a-z, A-Z).
405
405
///
406
406
/// This method is identical to [`is_alphabetic()`](#method.is_alphabetic)
407
- pub fn is_ascii_alphabetic ( & self ) -> bool {
407
+ #[ inline]
408
+ pub const fn is_ascii_alphabetic ( & self ) -> bool {
408
409
self . is_alphabetic ( )
409
410
}
410
411
@@ -452,7 +453,8 @@ impl AsciiChar {
452
453
/// Check if the character is a letter or number
453
454
///
454
455
/// This method is identical to [`is_alphanumeric()`](#method.is_alphanumeric)
455
- pub fn is_ascii_alphanumeric ( & self ) -> bool {
456
+ #[ inline]
457
+ pub const fn is_ascii_alphanumeric ( & self ) -> bool {
456
458
self . is_alphanumeric ( )
457
459
}
458
460
@@ -469,8 +471,8 @@ impl AsciiChar {
469
471
/// assert!(!AsciiChar::FF.is_ascii_blank());
470
472
/// ```
471
473
#[ inline]
472
- pub const fn is_ascii_blank ( self ) -> bool {
473
- ( self as u8 == b' ' ) | ( self as u8 == b'\t' )
474
+ pub const fn is_ascii_blank ( & self ) -> bool {
475
+ ( * self as u8 == b' ' ) | ( * self as u8 == b'\t' )
474
476
}
475
477
476
478
/// Check if the character one of ' ', '\t', '\n', '\r',
@@ -485,8 +487,10 @@ impl AsciiChar {
485
487
///
486
488
/// This method is NOT identical to `is_whitespace()`.
487
489
#[ inline]
488
- pub const fn is_ascii_whitespace ( self ) -> bool {
489
- self . is_ascii_blank ( ) | ( self as u8 == b'\n' ) | ( self as u8 == b'\r' ) | ( self as u8 == 0x0c )
490
+ pub const fn is_ascii_whitespace ( & self ) -> bool {
491
+ self . is_ascii_blank ( )
492
+ | ( * self as u8 == b'\n' ) | ( * self as u8 == b'\r' )
493
+ | ( * self as u8 == 0x0c /*form feed*/ )
490
494
}
491
495
492
496
/// Check if the character is a control character
@@ -551,7 +555,8 @@ impl AsciiChar {
551
555
/// Checks if the character is alphabetic and lowercase (a-z).
552
556
///
553
557
/// This method is identical to [`is_lowercase()`](#method.is_lowercase)
554
- pub fn is_ascii_lowercase ( & self ) -> bool {
558
+ #[ inline]
559
+ pub const fn is_ascii_lowercase ( & self ) -> bool {
555
560
self . is_lowercase ( )
556
561
}
557
562
@@ -572,7 +577,8 @@ impl AsciiChar {
572
577
/// Checks if the character is alphabetic and uppercase (A-Z).
573
578
///
574
579
/// This method is identical to [`is_uppercase()`](#method.is_uppercase)
575
- pub fn is_ascii_uppercase ( & self ) -> bool {
580
+ #[ inline]
581
+ pub const fn is_ascii_uppercase ( & self ) -> bool {
576
582
self . is_uppercase ( )
577
583
}
578
584
0 commit comments