mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-10-01 12:20:39 +00:00
io: fix clippy lint in write_all
(#4358)
This commit is contained in:
parent
dda8da75d0
commit
47feaa7a89
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -283,7 +283,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install Rust
|
||||
run: rustup update 1.56 && rustup default 1.56
|
||||
run: rustup update 1.57 && rustup default 1.57
|
||||
- uses: Swatinem/rust-cache@v1
|
||||
- name: Install clippy
|
||||
run: rustup component add clippy
|
||||
|
@ -42,7 +42,7 @@ where
|
||||
while !me.buf.is_empty() {
|
||||
let n = ready!(Pin::new(&mut *me.writer).poll_write(cx, me.buf))?;
|
||||
{
|
||||
let (_, rest) = mem::replace(&mut *me.buf, &[]).split_at(n);
|
||||
let (_, rest) = mem::take(&mut *me.buf).split_at(n);
|
||||
*me.buf = rest;
|
||||
}
|
||||
if n == 0 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user