diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92a3958..e6656eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,14 +57,13 @@ jobs: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@master with: - toolchain: ${{ matrix.rust-version.version }} + toolchain: ${{ matrix.rust-version }} components: rustfmt, clippy - uses: taiki-e/install-action@cargo-hack - uses: Swatinem/rust-cache@v2 - name: Build run: | - cargo hack build --feature-powerset \ - --exclude-features "${{ matrix.rust-version.build-features-excluded }}" + cargo hack build --feature-powerset - name: Test # Dev dependencies have an MSRV > 1.70. if: ${{ matrix.rust-version.version == 'stable' }} diff --git a/Cargo.lock b/Cargo.lock index 016f8b5..4fecc91 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -301,9 +301,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" dependencies = [ "unicode-ident", ] diff --git a/Cargo.toml b/Cargo.toml index 499a3fb..5eec9a8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ keywords = ["buffers", "zero-copy", "io"] license = "Apache-2.0" readme = "README.md" repository = "https://github.com/sunshowers-code/buf-list" -rust-version = "1.39" +rust-version = "1.70" [lints] rust.unexpected_cfgs = { level = "warn", check-cfg = ["cfg(doc_cfg)"] } diff --git a/README.md b/README.md index c68af46..2a57a3e 100644 --- a/README.md +++ b/README.md @@ -99,8 +99,8 @@ fn into_try_stream(buf_list: BufList) -> impl TryStream io::Result<()> { // This is the same as read_impl as long as there's enough space. - let remaining = self.num_bytes(list).saturating_sub(self.pos); + let total = self.num_bytes(list); + let remaining = total.saturating_sub(self.pos); let buf_len = buf.len(); if remaining < buf_len as u64 { + // Rust 1.80 and above will cause the position to be set to the end + // of the buffer, due to (apparently) + // https://github.com/rust-lang/rust/pull/125404. Follow that + // behavior. + self.set_pos(list, total); return Err(io::Error::new( io::ErrorKind::UnexpectedEof, ReadExactError { remaining, buf_len }, diff --git a/src/lib.rs b/src/lib.rs index 6489113..fe1ef93 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -109,8 +109,8 @@ //! //! # Minimum supported Rust version //! -//! The minimum supported Rust version (MSRV) is **1.39**, same as the `bytes` crate. Optional -//! features may cause a bump in the MSRV. +//! The minimum supported Rust version (MSRV) is **1.70**. Optional features may +//! cause a bump in the MSRV. //! //! The MSRV is not expected to change in the future. If the MSRV changes, it will be accompanied by //! a major version bump to `buf-list`.