We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
UnsafeCell::get_mut()
core::lazy::OnceCell::get_mut()
1 parent d331cb7 commit e86ecdfCopy full SHA for e86ecdf
library/core/src/lazy.rs
@@ -102,8 +102,7 @@ impl<T> OnceCell<T> {
102
/// Returns `None` if the cell is empty.
103
#[unstable(feature = "once_cell", issue = "74465")]
104
pub fn get_mut(&mut self) -> Option<&mut T> {
105
- // SAFETY: Safe because we have unique access
106
- unsafe { &mut *self.inner.get() }.as_mut()
+ self.inner.get_mut().as_mut()
107
}
108
109
/// Sets the contents of the cell to `value`.
0 commit comments