Skip to content

Commit 479f736

Browse files
io: improve panic message of ReadBuf::put_slice() (#6629)
1 parent 17555d7 commit 479f736

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tokio/src/io/read_buf.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,9 @@ impl<'a> ReadBuf<'a> {
248248
pub fn put_slice(&mut self, buf: &[u8]) {
249249
assert!(
250250
self.remaining() >= buf.len(),
251-
"buf.len() must fit in remaining()"
251+
"buf.len() must fit in remaining(); buf.len() = {}, remaining() = {}",
252+
buf.len(),
253+
self.remaining()
252254
);
253255

254256
let amt = buf.len();

0 commit comments

Comments
 (0)