fn unlink_index(&mut self, index: usize) {
        // Easiest to handle the tail first.
        if Some(index) == self.entries_tail {
            self.entries_tail = self.entries[index].as_occupied().prev;
        }

        if Some(index) == self.entries_head {
            // unlinking the head is special.
            self.entries_head = self.entries[index].as_occupied_mut().next;
            if let Some(n) = self.entries_head {
                self.entries[n].as_occupied_mut().prev = None;
            }

            return;
        }

        // Otherwise we just do a standard linked list unlink.
        let old_prev = self.entries[index]
            .as_occupied_mut()
            .prev
            .expect("Isn't the head");
        let old_next = self.entries[index].as_occupied_mut().next;
        self.entries[old_prev].as_occupied_mut().next = old_next;
        if let Some(n) = old_next {
            self.entries[n].as_occupied_mut().prev = Some(old_prev);
        }
    }
/// Entirely unlink an occupied index from the list.
/// Used as a precursor step to lots of things such as patching up the head.
Entirely unlink an occupied index from the list.
Used as a precursor step to lots of things such as patching up the head.
Entirely unlink an occupied index from the list . Used as a precursor step to lots of things such as patching up the head .
fn unlink_index(&mut self, index: usize) {
        // Easiest to handle the tail first.
        if Some(index) == self.entries_tail {
            self.entries_tail = self.entries[index].as_occupied().prev;
        }
        if Some(index) == self.entries_head {
            // unlinking the head is special.
            self.entries_head = self.entries[index].as_occupied_mut().next;
            if let Some(n) = self.entries_head {
                self.entries[n].as_occupied_mut().prev = None;
            }
            return;
        }
        // Otherwise we just do a standard linked list unlink.
        let old_prev = self.entries[index]
            .as_occupied_mut()
            .prev
            .expect("Isn't the head");
        let old_next = self.entries[index].as_occupied_mut().next;
        self.entries[old_prev].as_occupied_mut().next = old_next;
        if let Some(n) = old_next {
            self.entries[n].as_occupied_mut().prev = Some(old_prev);
        }
    }
fn unlink_index ( & mut self , index : usize ) { // Easiest to handle the tail first. if Some ( index ) == self . entries_tail { self . entries_tail = self . entries [ index ] . as_occupied ( ) . prev ; } if Some ( index ) == self . entries_head { // unlinking the head is special. self . entries_head = self . entries [ index ] . as_occupied_mut ( ) . next ; if let Some ( n ) = self . entries_head { self . entries [ n ] . as_occupied_mut ( ) . prev = None ; } return ; } // Otherwise we just do a standard linked list unlink. let old_prev = self . entries [ index ] . as_occupied_mut ( ) . prev . expect ( " " ) ; let old_next = self . entries [ index ] . as_occupied_mut ( ) . next ; self . entries [ old_prev ] . as_occupied_mut ( ) . next = old_next ; if let Some ( n ) = old_next { self . entries [ n ] . as_occupied_mut ( ) . prev = Some ( old_prev ) ; } }
Entirely unlink an occupied index from the list.
Entirely unlink an occupied index from the list .
&mut self
index
usize
&mut self
index
usize