Encaspulate a bit better

This commit is contained in:
Gwilym Kuiper 2022-03-20 14:15:24 +00:00
parent 9bfb8de481
commit ab80f200e8

View file

@ -439,7 +439,7 @@ impl<K, V> Node<K, V> {
impl<K, V> Drop for Node<K, V> { impl<K, V> Drop for Node<K, V> {
fn drop(&mut self) { fn drop(&mut self) {
if self.distance_to_initial_bucket >= 0 { if self.has_value() {
unsafe { ptr::drop_in_place(self.key.as_mut_ptr()) }; unsafe { ptr::drop_in_place(self.key.as_mut_ptr()) };
unsafe { ptr::drop_in_place(self.value.as_mut_ptr()) }; unsafe { ptr::drop_in_place(self.value.as_mut_ptr()) };
} }