diff --git a/src/sys/statvfs.rs b/src/sys/statvfs.rs index 8de369f421..c2c86624c8 100644 --- a/src/sys/statvfs.rs +++ b/src/sys/statvfs.rs @@ -3,7 +3,7 @@ //! See [the man pages](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fstatvfs.html) //! for more details. use std::mem; -use std::os::unix::io::AsRawFd; +use std::os::unix::io::{AsFd, AsRawFd}; use libc::{self, c_ulong}; @@ -146,11 +146,11 @@ pub fn statvfs(path: &P) -> Result { } /// Return a `Statvfs` object with information about `fd` -pub fn fstatvfs(fd: &T) -> Result { +pub fn fstatvfs(fd: Fd) -> Result { unsafe { Errno::clear(); let mut stat = mem::MaybeUninit::::uninit(); - Errno::result(libc::fstatvfs(fd.as_raw_fd(), stat.as_mut_ptr())) + Errno::result(libc::fstatvfs(fd.as_fd().as_raw_fd(), stat.as_mut_ptr())) .map(|_| Statvfs(stat.assume_init())) } }