mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
cat: the function 'unistd::write' doesn't need a mutable reference
This commit is contained in:
parent
09178360d8
commit
9554710ab5
1 changed files with 1 additions and 1 deletions
|
@ -81,7 +81,7 @@ fn copy_exact(read_fd: RawFd, write_fd: RawFd, num_bytes: usize) -> nix::Result<
|
||||||
let mut buf = [0; BUF_SIZE];
|
let mut buf = [0; BUF_SIZE];
|
||||||
loop {
|
loop {
|
||||||
let read = unistd::read(read_fd, &mut buf[..left])?;
|
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;
|
left -= written;
|
||||||
if left == 0 {
|
if left == 0 {
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue