Skip to content

Commit d163663

Browse files
committed
Check in strictly::ChunkedBytes::bytes_vectored
Add a debug_assert checking the invariant that the staging buffer does not exceed the chunk size limit.
1 parent 49b4f75 commit d163663

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/strictly.rs

+1
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ impl Buf for ChunkedBytes {
223223
/// entries filled.
224224
#[inline]
225225
fn bytes_vectored<'a>(&'a self, dst: &mut [IoSlice<'a>]) -> usize {
226+
debug_assert!(self.inner.staging_len() <= self.inner.chunk_size());
226227
self.inner.bytes_vectored(dst)
227228
}
228229

0 commit comments

Comments
 (0)