Make BufMut an unsafe trait (#432)

Users of `BufMut` are unable to defend against incorrect implementations
of `BufMut`, this makes the trait unsafe to implement.

Fixes #329
This commit is contained in:
Carl Lerche
2020-10-16 15:45:38 -07:00
committed by GitHub
parent 94c543f74b
commit ced050730c
5 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -966,7 +966,7 @@ impl Buf for BytesMut {
}
}
impl BufMut for BytesMut {
unsafe impl BufMut for BytesMut {
#[inline]
fn remaining_mut(&self) -> usize {
usize::MAX - self.len()