Skip to content

Commit 2923d1b

Browse files
xtqqczzesylvestre
authored andcommitted
uucore: use transmute instead of raw pointers
1 parent 717fb6f commit 2923d1b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/uucore/src/lib/features/fsext.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,8 @@ impl FsMeta for StatFs {
853853
fn fsid(&self) -> u64 {
854854
// Use type inference to determine the type of f_fsid
855855
// (libc::__fsid_t on Android, libc::fsid_t on other platforms)
856-
let f_fsid: &[u32; 2] = unsafe { &*(&raw const self.f_fsid).cast() };
856+
let f_fsid = self.f_fsid;
857+
let f_fsid: [u32; 2] = unsafe { mem::transmute(f_fsid) };
857858
((u64::from(f_fsid[0])) << 32) | u64::from(f_fsid[1])
858859
}
859860
#[cfg(not(any(

0 commit comments

Comments
 (0)