Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Congyuwang committed Dec 21, 2023
1 parent 0f86dc9 commit 0494c67
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{
mem::offset_of,
ops::{Deref, DerefMut},
pin::Pin,
ptr::NonNull,
ptr::{self, NonNull},
};

/// Owned cell for data.
Expand Down Expand Up @@ -174,7 +174,7 @@ impl<T> ListHead<T> {
loop {
f(this.get());
let next = this.next.unwrap();
if next.as_ptr() as *const ListHead<T> == self as *const ListHead<T> {
if ptr::eq(next.as_ptr(), self) {
break;
}
this = unsafe { next.as_ref() };
Expand All @@ -190,7 +190,7 @@ impl<T> ListHead<T> {
loop {
f(this.get_mut());
let mut next = this.next.unwrap();
if next.as_ptr() as *const ListHead<T> == self as *const ListHead<T> {
if ptr::eq(next.as_ptr(), self) {
break;
}
this = unsafe { next.as_mut() };
Expand All @@ -206,7 +206,7 @@ impl<T> ListHead<T> {
loop {
f(this.get());
let prev = this.prev.unwrap();
if prev.as_ptr() as *const ListHead<T> == self as *const ListHead<T> {
if ptr::eq(prev.as_ptr(), self) {
break;
}
this = unsafe { prev.as_ref() };
Expand All @@ -222,7 +222,7 @@ impl<T> ListHead<T> {
loop {
f(this.get_mut());
let mut prev = this.prev.unwrap();
if prev.as_ptr() as *const ListHead<T> == self as *const ListHead<T> {
if ptr::eq(prev.as_ptr(), self) {
break;
}
this = unsafe { prev.as_mut() };
Expand Down

0 comments on commit 0494c67

Please sign in to comment.