From a4aba0a09a45dab95e1d258c20905340b23e3c78 Mon Sep 17 00:00:00 2001 From: Joseph Perez Date: Sun, 29 Oct 2023 13:50:36 +0100 Subject: [PATCH] refactor: remove useless `unsafe` in `get_mut` --- src/sync.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sync.rs b/src/sync.rs index 7f7e11c9..8500413e 100644 --- a/src/sync.rs +++ b/src/sync.rs @@ -149,8 +149,7 @@ impl GILOnceCell { /// 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.