Skip to content

Commit

Permalink
Merge pull request #138 from peamaeq/master
Browse files Browse the repository at this point in the history
Adjust unsafe blocks for the Drop impl
  • Loading branch information
jeromefroe authored Jun 16, 2022
2 parents 3106da9 + 2c0c81a commit 8d2d94c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -915,10 +915,10 @@ impl<K, V, S> Drop for LruCache<K, V, S> {
});
// We rebox the head/tail, and because these are maybe-uninit
// they do not have the absent k/v dropped.
unsafe {
let _head = *Box::from_raw(self.head);
let _tail = *Box::from_raw(self.tail);
}

let _head = unsafe { *Box::from_raw(self.head) };
let _tail = unsafe { *Box::from_raw(self.tail) };

}
}

Expand Down

0 comments on commit 8d2d94c

Please sign in to comment.