Removes and returns the value at the given ID index. Returns `None` if the index is out of bounds or if the value was already `None`. The vector is not shrunk after removal. # Examples ``` # use hashql_core::id::{IdVec, Id as _, newtype}; # newtype!(struct MyId(u32 is 0..=0xFFFF_FF00)); let mut vec = IdVec:: >::new(); vec.insert(MyId::from_usize(0), "hello".to_string()); let
(&mut self, index: I)
| 312 | /// assert!(vec[MyId::from_usize(0)].is_none()); |
| 313 | /// ``` |
| 314 | pub fn remove(&mut self, index: I) -> Option<T> { |
| 315 | self.get_mut(index)?.take() |
| 316 | } |
| 317 | |
| 318 | /// Returns `true` if the vector contains a value (not `None`) at the given ID index. |
| 319 | /// |