mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Fix some Clippy lints.
This commit is contained in:
parent
c23adde5a3
commit
3e5cd8815d
14 changed files with 37 additions and 43 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue