@@ -21,7 +21,10 @@ type GroupWord = u32;
2121pub type BitMaskWord = GroupWord ;
2222pub const BITMASK_STRIDE : usize = 8 ;
2323// We only care about the highest bit of each byte for the mask.
24- #[ allow( clippy:: cast_possible_truncation) ]
24+ #[ allow(
25+ clippy:: cast_possible_truncation,
26+ clippy:: unnecessary_cast,
27+ ) ]
2528pub const BITMASK_MASK : BitMaskWord = 0x8080_8080_8080_8080_u64 as GroupWord ;
2629
2730/// Helper function to replicate a byte across a `GroupWord`.
@@ -70,7 +73,7 @@ impl Group {
7073 #[ inline]
7174 #[ allow( clippy:: cast_ptr_alignment) ] // unaligned load
7275 pub unsafe fn load ( ptr : * const u8 ) -> Self {
73- Self ( ptr:: read_unaligned ( ptr as * const _ ) )
76+ Group ( ptr:: read_unaligned ( ptr as * const _ ) )
7477 }
7578
7679 /// Loads a group of bytes starting at the given address, which must be
@@ -80,7 +83,7 @@ impl Group {
8083 pub unsafe fn load_aligned ( ptr : * const u8 ) -> Self {
8184 // FIXME: use align_offset once it stabilizes
8285 debug_assert_eq ! ( ptr as usize & ( mem:: align_of:: <Self >( ) - 1 ) , 0 ) ;
83- Self ( ptr:: read ( ptr as * const _ ) )
86+ Group ( ptr:: read ( ptr as * const _ ) )
8487 }
8588
8689 /// Stores the group of bytes to the given address, which must be
@@ -143,6 +146,6 @@ impl Group {
143146 // !1000_0000 + 1 = 0111_1111 + 1 = 1000_0000 (no carry)
144147 // !0000_0000 + 0 = 1111_1111 + 0 = 1111_1111 (no carry)
145148 let full = !self . 0 & repeat ( 0x80 ) ;
146- Self ( !full + ( full >> 7 ) )
149+ Group ( !full + ( full >> 7 ) )
147150 }
148151}
0 commit comments