mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-24 07:53:00 +01:00
fix node.remove(), update next node pointer
This commit is contained in:
parent
599e6b3385
commit
bfb2f2e9e1
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user