aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Thayne McCombs <astrothayne@gmail.com> 2019-12-19 12:09:14 -0700
committerGravatar Sean McArthur <sean@seanmonstar.com> 2019-12-19 11:09:14 -0800
commit39b6646e669a35d40e0da8e582b234226f024cae (patch)
tree2bb9ed43794879355787047fe72060edfb1f18bf /src
parentc7cf71618071933eac2c18471427d30e6a630af5 (diff)
downloadbytes-39b6646e669a35d40e0da8e582b234226f024cae.tar.gz
bytes-39b6646e669a35d40e0da8e582b234226f024cae.tar.zst
bytes-39b6646e669a35d40e0da8e582b234226f024cae.zip
Re-add impl From<BytesMut> for Bytes (#348)
Diffstat (limited to 'src')
-rw-r--r--src/bytes_mut.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bytes_mut.rs b/src/bytes_mut.rs
index 7a15444..8579f8c 100644
--- a/src/bytes_mut.rs
+++ b/src/bytes_mut.rs
@@ -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()