mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-01-22 21:05:11 +00:00
remove unused
delete method
This commit is contained in:
parent
1133c72e77
commit
949828d942
2 changed files with 0 additions and 20 deletions
11
src/alloc.rs
11
src/alloc.rs
|
@ -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> {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue