Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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)"] }
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ fn into_try_stream<E>(buf_list: BufList) -> impl TryStream<Ok = Bytes, Error = E

## 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`.
Expand Down
1 change: 1 addition & 0 deletions proptest-regressions/cursor/tests.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cc bf8cfd35fe51927d4570039a090a23c4f78c40cf88e8e6ac80f6fe66f02e1a4b
8 changes: 7 additions & 1 deletion src/cursor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,15 @@ impl CursorData {

fn read_exact_impl(&mut self, list: &BufList, buf: &mut [u8]) -> 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 },
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
Loading