mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-11 00:00:23 +02:00
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:
+1
-1
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user