mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-17 00:00:14 +02:00
Add more conversion impls
This commit is contained in:
@@ -166,6 +166,12 @@ impl ops::Deref for Bytes {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<BytesMut> for Bytes {
|
||||
fn from(src: BytesMut) -> Bytes {
|
||||
src.freeze()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Vec<u8>> for Bytes {
|
||||
fn from(src: Vec<u8>) -> Bytes {
|
||||
BytesMut::from(src).freeze()
|
||||
|
||||
Reference in New Issue
Block a user