mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-09-14 19:16:17 +00:00
wc: adapt to API changes of uucore/pipes
This commit is contained in:
parent
5342bae38d
commit
563e3cefd0
2 changed files with 4 additions and 4 deletions
|
@ -19,7 +19,7 @@ use nix::sys::stat;
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
use std::io::{Seek, SeekFrom};
|
use std::io::{Seek, SeekFrom};
|
||||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||||
use std::os::unix::io::AsRawFd;
|
use std::os::fd::{AsFd, AsRawFd};
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
use std::os::windows::fs::MetadataExt;
|
use std::os::windows::fs::MetadataExt;
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
|
@ -43,7 +43,7 @@ const SPLICE_SIZE: usize = 128 * 1024;
|
||||||
/// caller will fall back to a simpler method.
|
/// caller will fall back to a simpler method.
|
||||||
#[inline]
|
#[inline]
|
||||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||||
fn count_bytes_using_splice(fd: &impl AsRawFd) -> Result<usize, usize> {
|
fn count_bytes_using_splice(fd: &impl AsFd) -> Result<usize, usize> {
|
||||||
let null_file = OpenOptions::new()
|
let null_file = OpenOptions::new()
|
||||||
.write(true)
|
.write(true)
|
||||||
.open("/dev/null")
|
.open("/dev/null")
|
||||||
|
|
|
@ -11,10 +11,10 @@ use std::fs::File;
|
||||||
use std::io::{BufRead, BufReader, Read, StdinLock};
|
use std::io::{BufRead, BufReader, Read, StdinLock};
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
use std::os::unix::io::AsRawFd;
|
use std::os::fd::{AsFd, AsRawFd};
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
pub trait WordCountable: AsRawFd + Read {
|
pub trait WordCountable: AsFd + AsRawFd + Read {
|
||||||
type Buffered: BufRead;
|
type Buffered: BufRead;
|
||||||
fn buffered(self) -> Self::Buffered;
|
fn buffered(self) -> Self::Buffered;
|
||||||
fn inner_file(&mut self) -> Option<&mut File>;
|
fn inner_file(&mut self) -> Option<&mut File>;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue