Skip to content

Commit

Permalink
io: improve panic message of ReadBuf::put_slice() (#6629)
Browse files Browse the repository at this point in the history
  • Loading branch information
inventednight committed Jun 12, 2024
1 parent 17555d7 commit 479f736
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 479f736

Please sign in to comment.