diff --git a/src/bytes_mut.rs b/src/bytes_mut.rs index 61c0460ca..1d68e8560 100644 --- a/src/bytes_mut.rs +++ b/src/bytes_mut.rs @@ -1054,6 +1054,19 @@ impl<'a> From<&'a str> for BytesMut { } } +impl From> for BytesMut { + fn from(src: Vec) -> BytesMut { + BytesMut::from_vec(src) + } +} + +impl From for BytesMut { + fn from(src: Bytes) -> BytesMut { + // TODO: can be optimized for certain `Bytes` representations + BytesMut::from(src.as_ref()) + } +} + impl From for Bytes { fn from(src: BytesMut) -> Bytes { src.freeze()