pub fn remove(&mut self, index: Index<EntryData>) -> Option<EntryData> {
        let (previous_index, next_index) = match &self.entries[index.index] {
            Entry::Occupied(entry) if entry.generation == index.generation => {
                (entry.previous, entry.next)
            }
            _ => return None,
        };
        Some(
            self.remove_helper(previous_index, index.index, next_index)
                .value,
        )
    }
/// Removes and returns the value at the given index, if it exists.
///
/// If the index refers to an index not in the list anymore or if the index has been
/// invalidated, then [`None`] will be returned and the list will be unaffected.
///
/// Complexity: O(1)
///
/// # Examples
///
/// ```
/// use dlv_list::VecList;
///
/// let mut list = VecList::new();
/// let index = list.push_back(0);
/// assert_eq!(list.remove(index), Some(0));
/// assert_eq!(list.remove(index), None);
/// ```
Removes and returns the value at the given index, if it exists.
If the index refers to an index not in the list anymore or if the index has been
invalidated, then [`None`] will be returned and the list will be unaffected.


Removes and returns the value at the given index if it exists . If the index refers to an index not in the list anymore or if the index has been invalidated then [ ` None ` ] will be returned and the list will be unaffected .
pub fn remove(&mut self, index: Index<EntryData>) -> Option<EntryData> {
        let (previous_index, next_index) = match &self.entries[index.index] {
            Entry::Occupied(entry) if entry.generation == index.generation => {
                (entry.previous, entry.next)
            }
            _ => return None,
        };
        Some(
            self.remove_helper(previous_index, index.index, next_index)
                .value,
        )
    }
pub fn remove ( & mut self , index : Index < EntryData > ) -> Option < EntryData > { let ( previous_index , next_index ) = match & self . entries [ index . index ] { Entry :: Occupied ( entry ) if entry . generation == index . generation => { ( entry . previous , entry . next ) } _ => return None , } ; Some ( self . remove_helper ( previous_index , index . index , next_index ) . value , ) }
Removes and returns the value at the given index, if it exists.
Removes and returns the value at the given index if it exists .
&mut self
index
Index<EntryData>
&mut self
index
Index<EntryData>
examples
```
use dlv_list::VecList.

let mut list = VecList::new();
let index = list.push_back(0);
assert_eq!(list.remove(index), Some(0));
assert_eq!(list.remove(index), None);
```
` ` ` use dlv_list :: VecList . let mut list = VecList :: new () ; let index = list . push_back ( 0 ) ; assert_eq! ( list . remove ( index ) Some ( 0 )) ; assert_eq! ( list . remove ( index ) None ) ; ` ` `