1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-27 17:52:56 +01:00

fix node.remove(), update next node pointer

This commit is contained in:
Nikolay Kim 2018-09-17 10:25:45 -07:00
parent 599e6b3385
commit bfb2f2e9e1

View File

@ -226,12 +226,15 @@ impl<T> Node<T> {
fn remove(&mut self) {
unsafe {
self.element = ptr::null_mut();
let next = self.next.take();
let mut next = self.next.take();
let mut prev = self.prev.take();
if let Some(ref mut prev) = prev {
prev.as_mut().unwrap().next = next;
}
if let Some(ref mut next) = next {
next.as_mut().unwrap().prev = prev;
}
}
}
}