mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
uucore: use transmute instead of raw pointers
This commit is contained in:
committed by
Sylvestre Ledru
parent
717fb6f16d
commit
2923d1b10b
@@ -853,7 +853,8 @@ impl FsMeta for StatFs {
|
||||
fn fsid(&self) -> u64 {
|
||||
// Use type inference to determine the type of f_fsid
|
||||
// (libc::__fsid_t on Android, libc::fsid_t on other platforms)
|
||||
let f_fsid: &[u32; 2] = unsafe { &*(&raw const self.f_fsid).cast() };
|
||||
let f_fsid = self.f_fsid;
|
||||
let f_fsid: [u32; 2] = unsafe { mem::transmute(f_fsid) };
|
||||
((u64::from(f_fsid[0])) << 32) | u64::from(f_fsid[1])
|
||||
}
|
||||
#[cfg(not(any(
|
||||
|
||||
Reference in New Issue
Block a user