mirror of
https://github.com/uutils/coreutils
synced 2024-11-17 10:18:11 +00:00
refactor/polish ~ fix cargo clippy
complaints (transmute_ptr_to_ptr)
This commit is contained in:
parent
1deac8df87
commit
58779be6bb
1 changed files with 2 additions and 2 deletions
|
@ -137,7 +137,7 @@ pub fn pretty_access(mode: mode_t) -> String {
|
|||
result
|
||||
}
|
||||
|
||||
use std::mem::{self, transmute};
|
||||
use std::mem;
|
||||
use std::path::Path;
|
||||
use std::borrow::Cow;
|
||||
use std::ffi::CString;
|
||||
|
@ -219,7 +219,7 @@ impl FsMeta for Sstatfs {
|
|||
// struct statvfs, containing an unsigned long f_fsid
|
||||
#[cfg(any(target_os = "macos", target_os = "freebsd", target_os = "linux"))]
|
||||
fn fsid(&self) -> u64 {
|
||||
let f_fsid: &[u32; 2] = unsafe { transmute(&self.f_fsid) };
|
||||
let f_fsid: &[u32; 2] = unsafe { &*(&self.f_fsid as *const uucore::libc::fsid_t as *const [u32; 2]) };
|
||||
(u64::from(f_fsid[0])) << 32 | u64::from(f_fsid[1])
|
||||
}
|
||||
#[cfg(not(any(target_os = "macos", target_os = "freebsd", target_os = "linux")))]
|
||||
|
|
Loading…
Reference in a new issue