diff --git a/src/alloc.rs b/src/alloc.rs index ed138158..557f429a 100644 --- a/src/alloc.rs +++ b/src/alloc.rs @@ -25,17 +25,6 @@ impl Alloc { pub unsafe fn as_mut(&mut self) -> &mut T { unsafe { self.data.as_mut() } } - - fn into_box(self) -> Box { - let data: *mut T = self.data.as_ptr(); - let data: Box = unsafe { Box::from_raw(data) }; - std::mem::forget(self); - data - } - - pub fn into_inner(self) -> T { - *self.into_box() - } } impl Drop for Alloc { diff --git a/src/input/struct_map.rs b/src/input/struct_map.rs index 88530027..c44c857c 100644 --- a/src/input/struct_map.rs +++ b/src/input/struct_map.rs @@ -85,13 +85,4 @@ where pub fn update(&mut self, id: Id) -> impl DerefMut> + '_ { 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> { - if let Some((_, data)) = self.map.remove(&id) { - Some(data.into_inner()) - } else { - None - } - } }