pub fn remove<Q: ?Sized>(&mut self, k: &Q) -> Option<V>
    where
        K: Borrow<Q>,
        Q: Eq + Hash
    {
        let removed = self.map.remove(Qey::from_ref(k));
        removed.map(|node| {
            self.detach(node);
            unsafe {
                // add to free list
                (*node).next = self.free;
                self.free = node;
                // drop the key and return the value
                drop(ptr::read(&(*node).key));
                ptr::read(&(*node).value)
            }
        })
    }
/// Removes and returns the value corresponding to the key from the map.
///
/// # Examples
///
/// ```
/// use mu_utils::LinkedHashMap;
/// let mut map = LinkedHashMap::new();
///
/// map.insert(2, "a");
///
/// assert_eq!(map.remove(&1), None);
/// assert_eq!(map.remove(&2), Some("a"));
/// assert_eq!(map.remove(&2), None);
/// assert_eq!(map.len(), 0);
/// ```
Removes and returns the value corresponding to the key from the map.
Removes and returns the value corresponding to the key from the map .
pub fn remove<Q: ?Sized>(&mut self, k: &Q) -> Option<V>
    where
        K: Borrow<Q>,
        Q: Eq + Hash
    {
        let removed = self.map.remove(Qey::from_ref(k));
        removed.map(|node| {
            self.detach(node);
            unsafe {
                // add to free list
                (*node).next = self.free;
                self.free = node;
                // drop the key and return the value
                drop(ptr::read(&(*node).key));
                ptr::read(&(*node).value)
            }
        })
    }
pub fn remove < Q : ? Sized > ( & mut self , k : & Q ) -> Option < V > where K : Borrow < Q > , Q : Eq + Hash { let removed = self . map . remove ( Qey :: from_ref ( k ) ) ; removed . map ( | node | { self . detach ( node ) ; unsafe { // add to free list ( * node ) . next = self . free ; self . free = node ; // drop the key and return the value drop ( ptr :: read ( & ( * node ) . key ) ) ; ptr :: read ( & ( * node ) . value ) } } ) }
Removes and returns the value corresponding to the key from the map.
Removes and returns the value corresponding to the key from the map .
&mut self
k
&Q
&mut self
k
&Q
examples
```
use mu_utils::LinkedHashMap;
let mut map = LinkedHashMap::new().




` ` ` use mu_utils :: LinkedHashMap ; let mut map = LinkedHashMap :: new () .