feat(http): add Into<Bytes> for Chunk

This commit is contained in:
Sean McArthur
2017-03-01 16:59:36 -08:00
parent abad0fcd72
commit fac3d70c0b

View File

@@ -43,6 +43,14 @@ impl From<Bytes> for Chunk {
} }
} }
impl From<Chunk> for Bytes {
fn from(chunk: Chunk) -> Bytes {
match self.0 {
Inner::Shared(bytes) => bytes,
}
}
}
impl ::std::ops::Deref for Chunk { impl ::std::ops::Deref for Chunk {
type Target = [u8]; type Target = [u8];