io: improve panic message of ReadBuf::put_slice() (#6629)

This commit is contained in:
Niki C
2024-06-13 01:09:59 +09:00
committed by GitHub
parent 17555d71d9
commit 479f736935
+3 -1
View File
@@ -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();