wc: remove else

This commit is contained in:
oech3
2026-05-06 16:25:45 +02:00
committed by Daniel Hofstetter
parent bd170a5d4b
commit 0ddd6f487c
+2 -3
View File
@@ -53,8 +53,9 @@ fn count_bytes_using_splice(fd: &impl AsFd) -> Result<usize, usize> {
Err(_) => return Err(byte_count),
}
}
} else if let Ok((pipe_rd, pipe_wr)) = pipe() {
} else {
// input is not pipe. needs broker to use splice() with additional cost
let (pipe_rd, pipe_wr) = pipe().map_err(|_| 0_usize)?;
loop {
match splice(fd, &pipe_wr, MAX_ROOTLESS_PIPE_SIZE) {
Ok(0) => return Ok(byte_count),
@@ -65,8 +66,6 @@ fn count_bytes_using_splice(fd: &impl AsFd) -> Result<usize, usize> {
Err(_) => return Err(byte_count),
}
}
} else {
Err(0)
}
}