if new_last.is_null() {
// The list is now empty.
self.first = new_last;
+ } else {
+ unsafe { (*new_last).next = ptr::null_mut() };
}
let last = unsafe { raw_into_box(last) } ;
Some(last.data)
if new_first.is_null() {
// The list is now empty.
self.last = new_first;
+ } else {
+ unsafe { (*new_first).prev = ptr::null_mut() };
}
let first = unsafe { raw_into_box(first) } ;
Some(first.data)