mirror of
https://github.com/actix/actix-web.git
synced 2024-11-03 15:39:50 +00:00
fix node.remove(), update next node pointer
This commit is contained in:
parent
599e6b3385
commit
bfb2f2e9e1
1 changed files with 4 additions and 1 deletions
|
@ -226,12 +226,15 @@ impl<T> Node<T> {
|
||||||
fn remove(&mut self) {
|
fn remove(&mut self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
self.element = ptr::null_mut();
|
self.element = ptr::null_mut();
|
||||||
let next = self.next.take();
|
let mut next = self.next.take();
|
||||||
let mut prev = self.prev.take();
|
let mut prev = self.prev.take();
|
||||||
|
|
||||||
if let Some(ref mut prev) = prev {
|
if let Some(ref mut prev) = prev {
|
||||||
prev.as_mut().unwrap().next = next;
|
prev.as_mut().unwrap().next = next;
|
||||||
}
|
}
|
||||||
|
if let Some(ref mut next) = next {
|
||||||
|
next.as_mut().unwrap().prev = prev;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue