Fix some Clippy lints.

This commit is contained in:
Teymour Aldridge 2022-08-04 00:13:36 +08:00
parent c23adde5a3
commit 3e5cd8815d
14 changed files with 37 additions and 43 deletions

View file

@ -831,6 +831,7 @@ impl<H, T> Arc<HeaderSlice<H, [T]>> {
}
#[inline]
#[allow(clippy::uninit_vec)]
unsafe fn allocate_buffer<W>(size: usize) -> *mut u8 {
// We use Vec because the underlying allocation machinery isn't
// available in stable Rust. To avoid alignment issues, we allocate
@ -1101,9 +1102,7 @@ impl<T> Clone for RawOffsetArc<T> {
impl<T> Drop for RawOffsetArc<T> {
fn drop(&mut self) {
let _ = Arc::from_raw_offset(RawOffsetArc {
ptr: self.ptr.clone(),
});
let _ = Arc::from_raw_offset(RawOffsetArc { ptr: self.ptr });
}
}
@ -1117,10 +1116,6 @@ impl<T: PartialEq> PartialEq for RawOffsetArc<T> {
fn eq(&self, other: &RawOffsetArc<T>) -> bool {
*(*self) == *(*other)
}
fn ne(&self, other: &RawOffsetArc<T>) -> bool {
*(*self) != *(*other)
}
}
impl<T> RawOffsetArc<T> {
@ -1252,7 +1247,7 @@ impl<'a, T> ArcBorrow<'a, T> {
/// Compare two `ArcBorrow`s via pointer equality. Will only return
/// true if they come from the same allocation
pub fn ptr_eq(this: &Self, other: &Self) -> bool {
this.0 as *const T == other.0 as *const T
std::ptr::eq(this.0, other.0)
}
/// Temporarily converts |self| into a bonafide Arc and exposes it to the