Replace unneeded unsafe
calls to .get()
with calls to .get_mut()
This commit is contained in:
parent
8169989507
commit
5886c38112
5 changed files with 7 additions and 16 deletions
|
@ -406,9 +406,7 @@ impl<T: ?Sized> Mutex<T> {
|
|||
/// ```
|
||||
#[stable(feature = "mutex_get_mut", since = "1.6.0")]
|
||||
pub fn get_mut(&mut self) -> LockResult<&mut T> {
|
||||
// We know statically that there are no other references to `self`, so
|
||||
// there's no need to lock the inner mutex.
|
||||
let data = unsafe { &mut *self.data.get() };
|
||||
let data = self.data.get_mut();
|
||||
poison::map_result(self.poison.borrow(), |_| data)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue