Skip to content

Commit 4b53a29

Browse files
authored
Tweak BytesMut::remaining_mut (#795)
1 parent 016fdbd commit 4b53a29

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bytes_mut.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,8 @@ impl Buf for BytesMut {
11701170
unsafe impl BufMut for BytesMut {
11711171
#[inline]
11721172
fn remaining_mut(&self) -> usize {
1173-
usize::MAX - self.len()
1173+
// Max allocation size is isize::MAX.
1174+
isize::MAX as usize - self.len()
11741175
}
11751176

11761177
#[inline]

0 commit comments

Comments
 (0)