Skip to content

Commit

Permalink
Include relevant values in ReadBuf.put_slice() panic message tokio-rs…
Browse files Browse the repository at this point in the history
  • Loading branch information
inventednight committed Jun 11, 2024
1 parent 17555d7 commit 2d8c6ea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tokio/src/io/read_buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ impl<'a> ReadBuf<'a> {
pub fn put_slice(&mut self, buf: &[u8]) {
assert!(
self.remaining() >= buf.len(),
"buf.len() must fit in remaining()"
"buf.len() must fit in remaining(); buf.len() = {}, remaining() = {}",
buf.len(),
self.remaining()
);

let amt = buf.len();
Expand Down

0 comments on commit 2d8c6ea

Please sign in to comment.