Mark MutBuf::mut_buf as unsafe

`MutBuf::mut_buf` allows access to uninitialized memory.
This commit is contained in:
Carl Lerche
2015-07-26 11:02:46 -07:00
parent 296cac263c
commit b4abd1431a
6 changed files with 19 additions and 18 deletions
+1 -1
View File
@@ -321,7 +321,7 @@ impl MutBuf for MutByteBuf {
self.buf.advance(cnt)
}
fn mut_bytes<'a>(&'a mut self) -> &'a mut [u8] {
unsafe fn mut_bytes<'a>(&'a mut self) -> &'a mut [u8] {
let pos = self.buf.pos();
let lim = self.buf.lim();
&mut self.buf.mem.bytes_mut()[pos..lim]