Skip to content

Commit 96a7b97

Browse files
author
oech3
committed
buf_copy/linux.rs: drop unused trait
1 parent c90f1ea commit 96a7b97

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

  • src/uucore/src/lib/features/buf_copy

src/uucore/src/lib/features/buf_copy/linux.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,9 @@ use crate::error::UResult;
1010
/// Buffer-based copying utilities for unix (excluding Linux).
1111
use std::{
1212
io::{Read, Write},
13-
os::fd::{AsFd, AsRawFd},
13+
os::fd::AsFd,
1414
};
1515

16-
/// A readable file descriptor.
17-
pub trait FdReadable: Read + AsRawFd + AsFd {}
18-
19-
impl<T> FdReadable for T where T: Read + AsFd + AsRawFd {}
20-
21-
/// A writable file descriptor.
22-
pub trait FdWritable: Write + AsFd + AsRawFd {}
23-
24-
impl<T> FdWritable for T where T: Write + AsFd + AsRawFd {}
25-
2616
/// Copy data from `Read` implementor `source` into a `Write` implementor
2717
/// `dest`. This works by reading a chunk of data from `source` and writing the
2818
/// data to `dest` in a loop.
@@ -36,8 +26,8 @@ impl<T> FdWritable for T where T: Write + AsFd + AsRawFd {}
3626
/// * `dest` - `Write` implementor to copy data to.
3727
pub fn copy_stream<R, S>(src: &mut R, dest: &mut S) -> UResult<()>
3828
where
39-
R: Read + AsFd + AsRawFd,
40-
S: Write + AsFd + AsRawFd,
29+
R: Read + AsFd,
30+
S: Write + AsFd,
4131
{
4232
// If we're on Linux or Android, try to use the splice() system call
4333
// for faster writing. If it works, we're done.

0 commit comments

Comments
 (0)