mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-11 00:00:23 +02:00
Mark MutBuf::mut_buf as unsafe
`MutBuf::mut_buf` allows access to uninitialized memory.
This commit is contained in:
+4
-1
@@ -30,7 +30,10 @@ pub fn test_vec_as_mut_buf() {
|
||||
let mut buf = vec![];
|
||||
|
||||
assert_eq!(buf.remaining(), usize::MAX);
|
||||
assert_eq!(buf.mut_bytes().len(), 64);
|
||||
|
||||
unsafe {
|
||||
assert_eq!(buf.mut_bytes().len(), 64);
|
||||
}
|
||||
|
||||
buf.write(&b"zomg"[..]).unwrap();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user