Remove resource method get_mut

This commit is contained in:
hodasemi 2025-04-05 09:56:25 +02:00
parent cbe4e4ac40
commit a4c083f727

View file

@ -76,10 +76,6 @@ impl Resources {
.flatten() .flatten()
} }
pub fn get_mut<T: Resource>(&mut self) -> &mut T {
self.get_mut_opt::<T>().unwrap()
}
pub fn get_mut_by_type_id<T: Resource>(&mut self, type_id: TypeId) -> &mut T { pub fn get_mut_by_type_id<T: Resource>(&mut self, type_id: TypeId) -> &mut T {
self.get_mut_opt_by_type_id(type_id).unwrap() self.get_mut_opt_by_type_id(type_id).unwrap()
} }
@ -89,7 +85,7 @@ impl Resources {
} }
pub fn get_mut_unchecked<'a, T: Resource>(&mut self) -> &'a mut T { pub fn get_mut_unchecked<'a, T: Resource>(&mut self) -> &'a mut T {
unsafe { remove_life_time_mut(self.get_mut::<T>()) } unsafe { remove_life_time_mut(GetDisjointMut::<'_, &'_ mut T>::get_mut(self).unwrap()) }
} }
pub fn get_mut_opt<T: Resource>(&mut self) -> Option<&mut T> { pub fn get_mut_opt<T: Resource>(&mut self) -> Option<&mut T> {