Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerhawkes committed Jun 18, 2021
2 parents 0c50259 + ce683a5 commit 90bd5cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ jobs:
- run: cargo install cross
- run: cross test --target ${{ matrix.target }} --workspace --all-features
- run: cross test --target ${{ matrix.target }} --workspace --all-features --release
# TODO: https://github.com/rust-lang/futures-rs/issues/2451
if: matrix.target != 'aarch64-unknown-linux-gnu'

core-msrv:
name: cargo +${{ matrix.rust }} build (futures-{core, io, sink, task})
Expand Down Expand Up @@ -254,12 +256,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust and Clippy
run: |
toolchain=nightly-$(curl -sSf https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/clippy)
rustup set profile minimal
rustup default "$toolchain"
rustup component add clippy
- name: Install Rust
run: rustup toolchain install nightly --component clippy && rustup default nightly
- run: cargo clippy --workspace --all-features --all-targets

fmt:
Expand Down
8 changes: 4 additions & 4 deletions futures-util/src/io/write_all_vectored.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use futures_core::task::{Context, Poll};
use futures_io::AsyncWrite;
use futures_io::IoSlice;
use std::io;
use std::mem;
use std::pin::Pin;

/// Future for the
Expand All @@ -19,8 +18,9 @@ pub struct WriteAllVectored<'a, W: ?Sized + Unpin> {
impl<W: ?Sized + Unpin> Unpin for WriteAllVectored<'_, W> {}

impl<'a, W: AsyncWrite + ?Sized + Unpin> WriteAllVectored<'a, W> {
pub(super) fn new(writer: &'a mut W, bufs: &'a mut [IoSlice<'a>]) -> Self {
Self { writer, bufs: IoSlice::advance(bufs, 0) }
pub(super) fn new(writer: &'a mut W, mut bufs: &'a mut [IoSlice<'a>]) -> Self {
IoSlice::advance_slices(&mut bufs, 0);
Self { writer, bufs }
}
}

Expand All @@ -34,7 +34,7 @@ impl<W: AsyncWrite + ?Sized + Unpin> Future for WriteAllVectored<'_, W> {
if n == 0 {
return Poll::Ready(Err(io::ErrorKind::WriteZero.into()));
} else {
this.bufs = IoSlice::advance(mem::take(&mut this.bufs), n);
IoSlice::advance_slices(&mut this.bufs, n);
}
}

Expand Down

0 comments on commit 90bd5cc

Please sign in to comment.