Skip to content

Commit

Permalink
refactor: remove useless unsafe in get_mut
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Perez committed Oct 29, 2023
1 parent bb1cc93 commit 1fd4090
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/sync.rs
Expand Up @@ -149,8 +149,7 @@ impl<T> GILOnceCell<T> {
/// Get the contents of the cell mutably. This is only possible if the reference to the cell is
/// unique.
pub fn get_mut(&mut self) -> Option<&mut T> {
// Safe because we have &mut self
unsafe { &mut *self.0.get() }.as_mut()
self.0.get_mut().as_mut()
}

/// Set the value in the cell.
Expand Down

0 comments on commit 1fd4090

Please sign in to comment.