diff --git a/src/uu/wc/src/count_fast.rs b/src/uu/wc/src/count_fast.rs index 85d3d1d2b..7edc02437 100644 --- a/src/uu/wc/src/count_fast.rs +++ b/src/uu/wc/src/count_fast.rs @@ -19,7 +19,7 @@ use nix::sys::stat; #[cfg(unix)] use std::io::{Seek, SeekFrom}; #[cfg(any(target_os = "linux", target_os = "android"))] -use std::os::unix::io::AsRawFd; +use std::os::fd::{AsFd, AsRawFd}; #[cfg(windows)] use std::os::windows::fs::MetadataExt; #[cfg(windows)] @@ -43,7 +43,7 @@ const SPLICE_SIZE: usize = 128 * 1024; /// caller will fall back to a simpler method. #[inline] #[cfg(any(target_os = "linux", target_os = "android"))] -fn count_bytes_using_splice(fd: &impl AsRawFd) -> Result { +fn count_bytes_using_splice(fd: &impl AsFd) -> Result { let null_file = OpenOptions::new() .write(true) .open("/dev/null") diff --git a/src/uu/wc/src/countable.rs b/src/uu/wc/src/countable.rs index d27c7fb59..5b2ad7a99 100644 --- a/src/uu/wc/src/countable.rs +++ b/src/uu/wc/src/countable.rs @@ -11,10 +11,10 @@ use std::fs::File; use std::io::{BufRead, BufReader, Read, StdinLock}; #[cfg(unix)] -use std::os::unix::io::AsRawFd; +use std::os::fd::{AsFd, AsRawFd}; #[cfg(unix)] -pub trait WordCountable: AsRawFd + Read { +pub trait WordCountable: AsFd + AsRawFd + Read { type Buffered: BufRead; fn buffered(self) -> Self::Buffered; fn inner_file(&mut self) -> Option<&mut File>;