Skip to content

Commit

Permalink
Re-add impl From<BytesMut> for Bytes (tokio-rs#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmccombs authored and seanmonstar committed Dec 19, 2019
1 parent c7cf716 commit 39b6646
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/bytes_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,12 @@ impl<'a> From<&'a str> for BytesMut {
}
}

impl From<BytesMut> for Bytes {
fn from(src: BytesMut) -> Bytes {
src.freeze()
}
}

impl PartialEq for BytesMut {
fn eq(&self, other: &BytesMut) -> bool {
self.as_slice() == other.as_slice()
Expand Down

0 comments on commit 39b6646

Please sign in to comment.