Skip to content

Commit d73e018

Browse files
committed
uucore: use raw pointers for libc stat calls to satisfy clippy
1 parent a045de6 commit d73e018

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • src/uucore/src/lib/features

src/uucore/src/lib/features/fs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl FileInformation {
6868
pub fn from_file(file: &fs::File) -> IOResult<Self> {
6969
use std::os::fd::AsRawFd;
7070
let mut stat: libc::stat = unsafe { std::mem::zeroed() };
71-
if unsafe { libc::fstat(file.as_raw_fd(), &mut stat) } != 0 {
71+
if unsafe { libc::fstat(file.as_raw_fd(), &raw mut stat) } != 0 {
7272
return Err(Error::last_os_error());
7373
}
7474
Ok(Self(stat))
@@ -111,9 +111,9 @@ impl FileInformation {
111111
.map_err(|e| Error::new(ErrorKind::InvalidInput, e))?;
112112
let mut stat: libc::stat = unsafe { std::mem::zeroed() };
113113
let res = if dereference {
114-
unsafe { libc::stat(path_c.as_ptr(), &mut stat) }
114+
unsafe { libc::stat(path_c.as_ptr(), &raw mut stat) }
115115
} else {
116-
unsafe { libc::lstat(path_c.as_ptr(), &mut stat) }
116+
unsafe { libc::lstat(path_c.as_ptr(), &raw mut stat) }
117117
};
118118
if res != 0 {
119119
return Err(Error::last_os_error());

0 commit comments

Comments
 (0)