@@ -585,7 +585,9 @@ impl u8 {
585
585
#[ rustc_const_stable( feature = "const_ascii_methods_on_intrinsics" , since = "1.52.0" ) ]
586
586
#[ inline]
587
587
pub const fn eq_ignore_ascii_case ( & self , other : & u8 ) -> bool {
588
- self . to_ascii_lowercase ( ) == other. to_ascii_lowercase ( )
588
+ #[ allow( clippy:: manual_ignore_case_cmp) ] // exempt by being the one true definition
589
+ self . to_ascii_lowercase ( )
590
+ == other. to_ascii_lowercase ( )
589
591
}
590
592
591
593
/// Converts this value to its ASCII upper case equivalent in-place.
@@ -673,6 +675,7 @@ impl u8 {
673
675
#[ rustc_const_stable( feature = "const_ascii_ctype_on_intrinsics" , since = "1.47.0" ) ]
674
676
#[ inline]
675
677
pub const fn is_ascii_alphabetic ( & self ) -> bool {
678
+ #![ allow( clippy:: manual_is_ascii_check) ] // exempt by being the one true definition
676
679
matches ! ( * self , b'A' ..=b'Z' | b'a' ..=b'z' )
677
680
}
678
681
@@ -707,6 +710,7 @@ impl u8 {
707
710
#[ rustc_const_stable( feature = "const_ascii_ctype_on_intrinsics" , since = "1.47.0" ) ]
708
711
#[ inline]
709
712
pub const fn is_ascii_uppercase ( & self ) -> bool {
713
+ #![ allow( clippy:: manual_is_ascii_check) ] // exempt by being the one true definition
710
714
matches ! ( * self , b'A' ..=b'Z' )
711
715
}
712
716
@@ -741,6 +745,7 @@ impl u8 {
741
745
#[ rustc_const_stable( feature = "const_ascii_ctype_on_intrinsics" , since = "1.47.0" ) ]
742
746
#[ inline]
743
747
pub const fn is_ascii_lowercase ( & self ) -> bool {
748
+ #![ allow( clippy:: manual_is_ascii_check) ] // exempt by being the one true definition
744
749
matches ! ( * self , b'a' ..=b'z' )
745
750
}
746
751
@@ -778,7 +783,8 @@ impl u8 {
778
783
#[ rustc_const_stable( feature = "const_ascii_ctype_on_intrinsics" , since = "1.47.0" ) ]
779
784
#[ inline]
780
785
pub const fn is_ascii_alphanumeric ( & self ) -> bool {
781
- matches ! ( * self , b'0' ..=b'9' ) | matches ! ( * self , b'A' ..=b'Z' ) | matches ! ( * self , b'a' ..=b'z' )
786
+ #![ allow( clippy:: manual_is_ascii_check) ] // exempt by being the one true definition
787
+ matches ! ( * self , b'0' ..=b'9' | b'A' ..=b'Z' | b'a' ..=b'z' )
782
788
}
783
789
784
790
/// Checks if the value is an ASCII decimal digit:
@@ -812,6 +818,7 @@ impl u8 {
812
818
#[ rustc_const_stable( feature = "const_ascii_ctype_on_intrinsics" , since = "1.47.0" ) ]
813
819
#[ inline]
814
820
pub const fn is_ascii_digit ( & self ) -> bool {
821
+ #![ allow( clippy:: manual_is_ascii_check) ] // exempt by being the one true definition
815
822
matches ! ( * self , b'0' ..=b'9' )
816
823
}
817
824
@@ -843,6 +850,7 @@ impl u8 {
843
850
#[ unstable( feature = "is_ascii_octdigit" , issue = "101288" ) ]
844
851
#[ inline]
845
852
pub const fn is_ascii_octdigit ( & self ) -> bool {
853
+ #![ allow( clippy:: manual_is_ascii_check) ] // exempt by being the one true definition
846
854
matches ! ( * self , b'0' ..=b'7' )
847
855
}
848
856
@@ -880,7 +888,8 @@ impl u8 {
880
888
#[ rustc_const_stable( feature = "const_ascii_ctype_on_intrinsics" , since = "1.47.0" ) ]
881
889
#[ inline]
882
890
pub const fn is_ascii_hexdigit ( & self ) -> bool {
883
- matches ! ( * self , b'0' ..=b'9' ) | matches ! ( * self , b'A' ..=b'F' ) | matches ! ( * self , b'a' ..=b'f' )
891
+ #![ allow( clippy:: manual_is_ascii_check) ] // exempt by being the one true definition
892
+ matches ! ( * self , b'0' ..=b'9' | b'A' ..=b'F' | b'a' ..=b'f' )
884
893
}
885
894
886
895
/// Checks if the value is an ASCII punctuation character:
0 commit comments