impl BorrowMut for BytesMut (#185) (#192)

This commit is contained in:
Alan Somers
2018-04-27 11:08:50 -06:00
committed by Carl Lerche
parent 3ede899c82
commit 95462b18cc
+7 -1
View File
@@ -3,7 +3,7 @@ use buf::Iter;
use debug;
use std::{cmp, fmt, mem, hash, ops, slice, ptr, usize};
use std::borrow::Borrow;
use std::borrow::{Borrow, BorrowMut};
use std::io::Cursor;
use std::sync::atomic::{self, AtomicUsize, AtomicPtr};
use std::sync::atomic::Ordering::{Relaxed, Acquire, Release, AcqRel};
@@ -1622,6 +1622,12 @@ impl Borrow<[u8]> for BytesMut {
}
}
impl BorrowMut<[u8]> for BytesMut {
fn borrow_mut(&mut self) -> &mut [u8] {
self.as_mut()
}
}
impl fmt::Write for BytesMut {
#[inline]
fn write_str(&mut self, s: &str) -> fmt::Result {