mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-23 02:27:39 +03:00
Fix an unnecessary use of cast::transmute
Wherever possible, more specialized variants of said functions should be used, such as in this case `cast::transmute_mmut_unsafe`.
This commit is contained in:
+1
-1
@@ -63,7 +63,7 @@ pub fn new(value: T) -> Unsafe<T> {
|
||||
|
||||
/// Gets a mutable pointer to the wrapped value
|
||||
#[inline]
|
||||
pub unsafe fn get(&self) -> *mut T { cast::transmute(&self.value) }
|
||||
pub unsafe fn get(&self) -> *mut T { cast::transmute_mut_unsafe(&self.value) }
|
||||
|
||||
/// Unwraps the value
|
||||
#[inline]
|
||||
|
||||
Reference in New Issue
Block a user