Fix inherent impl overlap check.
This commit is contained in:
parent
0157cc977f
commit
a3f98a7501
3 changed files with 65 additions and 45 deletions
|
@ -741,6 +741,12 @@ impl<I: Idx, T> IndexVec<I, Option<T>> {
|
|||
self.ensure_contains_elem(index, || None);
|
||||
self[index].get_or_insert_with(value)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn remove(&mut self, index: I) -> Option<T> {
|
||||
self.ensure_contains_elem(index, || None);
|
||||
self[index].take()
|
||||
}
|
||||
}
|
||||
|
||||
impl<I: Idx, T: Clone> IndexVec<I, T> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue