aboutsummaryrefslogtreecommitdiff
path: root/src/bytes_mut.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bytes_mut.rs')
-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()