remove unused delete method

This commit is contained in:
Niko Matsakis 2024-07-19 09:49:22 -04:00
parent 1133c72e77
commit 949828d942
2 changed files with 0 additions and 20 deletions

View file

@ -25,17 +25,6 @@ impl<T> Alloc<T> {
pub unsafe fn as_mut(&mut self) -> &mut T {
unsafe { self.data.as_mut() }
}
fn into_box(self) -> Box<T> {
let data: *mut T = self.data.as_ptr();
let data: Box<T> = unsafe { Box::from_raw(data) };
std::mem::forget(self);
data
}
pub fn into_inner(self) -> T {
*self.into_box()
}
}
impl<T> Drop for Alloc<T> {

View file

@ -85,13 +85,4 @@ where
pub fn update(&mut self, id: Id) -> impl DerefMut<Target = Value<C>> + '_ {
RefMut::map(self.map.get_mut(&id).unwrap(), |v| unsafe { v.as_mut() })
}
/// Remove the entry for `id` from the map.
pub fn delete(&mut self, id: Id) -> Option<Value<C>> {
if let Some((_, data)) = self.map.remove(&id) {
Some(data.into_inner())
} else {
None
}
}
}