aboutsummaryrefslogtreecommitdiffstats
path: root/components/servo_arc/lib.rs
diff options
context:
space:
mode:
authorbors-servo <servo-ops@mozilla.com>2022-08-06 07:20:18 -0400
committerGitHub <noreply@github.com>2022-08-06 07:20:18 -0400
commit9c6847a387cb515bd73336cf1439c942a33a0758 (patch)
tree3c2dced21f2bd7e0c36354918499ac3fab2919ed /components/servo_arc/lib.rs
parent9c41c14649a8b42f81e6bd9ce76a546d9767c8e9 (diff)
parent3e5cd8815da2ef649658e45f949e29308d1bb853 (diff)
downloadservo-9c6847a387cb515bd73336cf1439c942a33a0758.tar.gz
servo-9c6847a387cb515bd73336cf1439c942a33a0758.zip
Auto merge of #28910 - teymour-aldridge:clippy, r=jdm
Fix some Clippy lints. <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [ ] These changes do not require tests because they do not change the behaviour of the code <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Diffstat (limited to 'components/servo_arc/lib.rs')
-rw-r--r--components/servo_arc/lib.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/components/servo_arc/lib.rs b/components/servo_arc/lib.rs
index bd6b5289504..27ea8e9ba71 100644
--- a/components/servo_arc/lib.rs
+++ b/components/servo_arc/lib.rs
@@ -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