1
Fork 0

rename get_{ref, mut} to assume_init_{ref,mut} in Maybeuninit

This commit is contained in:
DPC 2020-08-29 02:13:02 +02:00
parent bf4342114e
commit 5e208efaa8
4 changed files with 29 additions and 28 deletions

View file

@ -376,13 +376,13 @@ impl<T> SyncOnceCell<T> {
/// Safety: The value must be initialized
unsafe fn get_unchecked(&self) -> &T {
debug_assert!(self.is_initialized());
(&*self.value.get()).get_ref()
(&*self.value.get()).assume_init_ref()
}
/// Safety: The value must be initialized
unsafe fn get_unchecked_mut(&mut self) -> &mut T {
debug_assert!(self.is_initialized());
(&mut *self.value.get()).get_mut()
(&mut *self.value.get()).assume_init_mut()
}
}