Skip to content

Commit

Permalink
impl BorrowMut for BytesMut (#185) (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
asomers authored and carllerche committed Apr 27, 2018
1 parent ce79f0a commit 15050b1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/bytes.rs
Expand Up @@ -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};
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 15050b1

Please sign in to comment.