1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

cat: the function 'unistd::write' doesn't need a mutable reference

This commit is contained in:
Sylvestre Ledru 2021-05-02 10:31:28 +02:00
parent 09178360d8
commit 9554710ab5

View file

@ -81,7 +81,7 @@ fn copy_exact(read_fd: RawFd, write_fd: RawFd, num_bytes: usize) -> nix::Result<
let mut buf = [0; BUF_SIZE];
loop {
let read = unistd::read(read_fd, &mut buf[..left])?;
let written = unistd::write(write_fd, &mut buf[..read])?;
let written = unistd::write(write_fd, &buf[..read])?;
left -= written;
if left == 0 {
break;