@@ -411,7 +411,7 @@ impl AsciiChar {
411
411
#[ inline]
412
412
#[ must_use]
413
413
pub const fn is_alphabetic ( self ) -> bool {
414
- ( self . to_not_upper ( ) >= b'a' ) & ( self . to_not_upper ( ) <= b'z' )
414
+ ( self . to_not_upper ( ) >= b'a' ) && ( self . to_not_upper ( ) <= b'z' )
415
415
}
416
416
417
417
/// Check if the character is a letter (a-z, A-Z).
@@ -457,14 +457,14 @@ impl AsciiChar {
457
457
#[ inline]
458
458
#[ must_use]
459
459
pub const fn is_ascii_digit ( & self ) -> bool {
460
- ( * self as u8 >= b'0' ) & ( * self as u8 <= b'9' )
460
+ ( * self as u8 >= b'0' ) && ( * self as u8 <= b'9' )
461
461
}
462
462
463
463
/// Check if the character is a letter or number
464
464
#[ inline]
465
465
#[ must_use]
466
466
pub const fn is_alphanumeric ( self ) -> bool {
467
- self . is_alphabetic ( ) | self . is_ascii_digit ( )
467
+ self . is_alphabetic ( ) || self . is_ascii_digit ( )
468
468
}
469
469
470
470
/// Check if the character is a letter or number
@@ -491,7 +491,7 @@ impl AsciiChar {
491
491
#[ inline]
492
492
#[ must_use]
493
493
pub const fn is_ascii_blank ( & self ) -> bool {
494
- ( * self as u8 == b' ' ) | ( * self as u8 == b'\t' )
494
+ ( * self as u8 == b' ' ) || ( * self as u8 == b'\t' )
495
495
}
496
496
497
497
/// Check if the character one of ' ', '\t', '\n', '\r',
@@ -500,7 +500,7 @@ impl AsciiChar {
500
500
#[ must_use]
501
501
pub const fn is_whitespace ( self ) -> bool {
502
502
let b = self as u8 ;
503
- self . is_ascii_blank ( ) | ( b == b'\n' ) | ( b == b'\r' ) | ( b == 0x0b ) | ( b == 0x0c )
503
+ self . is_ascii_blank ( ) || ( b == b'\n' ) || ( b == b'\r' ) || ( b == 0x0b ) | | ( b == 0x0c )
504
504
}
505
505
506
506
/// Check if the character is a ' ', '\t', '\n', '\r' or '\0xc' (form feed).
@@ -510,9 +510,9 @@ impl AsciiChar {
510
510
#[ must_use]
511
511
pub const fn is_ascii_whitespace ( & self ) -> bool {
512
512
self . is_ascii_blank ( )
513
- | ( * self as u8 == b'\n' )
514
- | ( * self as u8 == b'\r' )
515
- | ( * self as u8 == 0x0c /*form feed*/ )
513
+ || ( * self as u8 == b'\n' )
514
+ || ( * self as u8 == b'\r' )
515
+ || ( * self as u8 == 0x0c /*form feed*/ )
516
516
}
517
517
518
518
/// Check if the character is a control character
@@ -530,7 +530,7 @@ impl AsciiChar {
530
530
#[ inline]
531
531
#[ must_use]
532
532
pub const fn is_ascii_control ( & self ) -> bool {
533
- ( ( * self as u8 ) < b' ' ) | ( * self as u8 == 127 )
533
+ ( ( * self as u8 ) < b' ' ) || ( * self as u8 == 127 )
534
534
}
535
535
536
536
/// Checks if the character is printable (except space)
@@ -624,7 +624,7 @@ impl AsciiChar {
624
624
#[ inline]
625
625
#[ must_use]
626
626
pub const fn is_ascii_punctuation ( & self ) -> bool {
627
- self . is_ascii_graphic ( ) & !self . is_alphanumeric ( )
627
+ self . is_ascii_graphic ( ) && !self . is_alphanumeric ( )
628
628
}
629
629
630
630
/// Checks if the character is a valid hex digit
@@ -641,7 +641,7 @@ impl AsciiChar {
641
641
#[ inline]
642
642
#[ must_use]
643
643
pub const fn is_ascii_hexdigit ( & self ) -> bool {
644
- self . is_ascii_digit ( ) | ( ( * self as u8 | 0x20_u8 ) . wrapping_sub ( b'a' ) < 6 )
644
+ self . is_ascii_digit ( ) || ( ( * self as u8 | 0x20u8 ) . wrapping_sub ( b'a' ) < 6 )
645
645
}
646
646
647
647
/// Unicode has printable versions of the ASCII control codes, like '␛'.
@@ -728,7 +728,7 @@ impl AsciiChar {
728
728
#[ must_use]
729
729
pub const fn eq_ignore_ascii_case ( & self , other : & Self ) -> bool {
730
730
( self . as_byte ( ) == other. as_byte ( ) )
731
- | ( self . is_alphabetic ( ) & ( self . to_not_upper ( ) == other. to_not_upper ( ) ) )
731
+ || ( self . is_alphabetic ( ) & & ( self . to_not_upper ( ) == other. to_not_upper ( ) ) )
732
732
}
733
733
}
734
734
0 commit comments