1
Fork 0

Replace NonZero::<_>::new with NonZero::new.

This commit is contained in:
Markus Reiter 2024-02-08 23:03:25 +01:00
parent 746a58d435
commit a90cc05233
No known key found for this signature in database
GPG key ID: 245293B51702655B
70 changed files with 175 additions and 216 deletions

View file

@ -143,15 +143,14 @@ where
// `{non_zero} | packed_tag` can't make the value zero.
let packed = (addr.get() >> T::BITS) | packed_tag;
unsafe { NonZero::<usize>::new_unchecked(packed) }
unsafe { NonZero::new_unchecked(packed) }
})
}
/// Retrieves the original raw pointer from `self.packed`.
#[inline]
pub(super) fn pointer_raw(&self) -> NonNull<P::Target> {
self.packed
.map_addr(|addr| unsafe { NonZero::<usize>::new_unchecked(addr.get() << T::BITS) })
self.packed.map_addr(|addr| unsafe { NonZero::new_unchecked(addr.get() << T::BITS) })
}
/// This provides a reference to the `P` pointer itself, rather than the