Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Darksonn committed Oct 1, 2023
1 parent 86920ce commit 0abd535
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bytes_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ unsafe impl BufMut for BytesMut {
unsafe fn advance_mut(&mut self, cnt: usize) {
let remaining = self.cap - self.len();
if cnt > remaining {
panic_advance(cnt, remaining);
super::panic_advance(cnt, remaining);
}
// Addition won't overflow since it is at most `self.cap`.
self.len = self.len() + cnt;
Expand Down
2 changes: 1 addition & 1 deletion tests/test_buf_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn test_put_int_le_nbytes_overflow() {
}

#[test]
#[should_panic(expected = "cannot advance")]
#[should_panic(expected = "advance out of bounds: the len is 8 but advancing by 12")]
fn test_vec_advance_mut() {
// Verify fix for #354
let mut buf = Vec::with_capacity(8);
Expand Down

0 comments on commit 0abd535

Please sign in to comment.