Skip to content

Commit 7599b35

Browse files
oech3cakebaker
authored andcommitted
uucore: simplify splice()
1 parent f9efb9e commit 7599b35

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/uucore/src/lib/features/pipes.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,8 @@ pub fn pipe() -> std::io::Result<(File, File)> {
4141
/// this is still very efficient.
4242
#[inline]
4343
#[cfg(any(target_os = "linux", target_os = "android"))]
44-
pub fn splice(source: &impl AsFd, target: &impl AsFd, len: usize) -> std::io::Result<usize> {
45-
Ok(rustix::pipe::splice(
46-
source,
47-
None,
48-
target,
49-
None,
50-
len,
51-
SpliceFlags::empty(),
52-
)?)
44+
pub fn splice(source: &impl AsFd, target: &impl AsFd, len: usize) -> rustix::io::Result<usize> {
45+
rustix::pipe::splice(source, None, target, None, len, SpliceFlags::empty())
5346
}
5447

5548
/// Splice wrapper which fully finishes the write.

0 commit comments

Comments
 (0)