Skip to content

Commit bf42bcf

Browse files
committed
lint
1 parent ef00f9f commit bf42bcf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,7 @@ impl<K: Hash + Eq, V, S: BuildHasher> LruCache<K, V, S> {
14991499
fn remove_first(&mut self) -> Option<Box<LruEntry<K, V>>> {
15001500
let next;
15011501
unsafe { next = (*self.head).next }
1502-
if next != self.tail {
1502+
if !core::ptr::eq(next, self.tail) {
15031503
let old_key = KeyRef {
15041504
k: unsafe { &(*(*(*self.head).next).key.as_ptr()) },
15051505
};
@@ -1515,7 +1515,7 @@ impl<K: Hash + Eq, V, S: BuildHasher> LruCache<K, V, S> {
15151515
fn remove_last(&mut self) -> Option<Box<LruEntry<K, V>>> {
15161516
let prev;
15171517
unsafe { prev = (*self.tail).prev }
1518-
if prev != self.head {
1518+
if !core::ptr::eq(prev, self.head) {
15191519
let old_key = KeyRef {
15201520
k: unsafe { &(*(*(*self.tail).prev).key.as_ptr()) },
15211521
};

0 commit comments

Comments
 (0)