Skip to content

Commit fac3d70

Browse files
committed
feat(http): add Into<Bytes> for Chunk
1 parent abad0fc commit fac3d70

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/http/chunk.rs

+8
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ impl From<Bytes> for Chunk {
4343
}
4444
}
4545

46+
impl From<Chunk> for Bytes {
47+
fn from(chunk: Chunk) -> Bytes {
48+
match self.0 {
49+
Inner::Shared(bytes) => bytes,
50+
}
51+
}
52+
}
53+
4654
impl ::std::ops::Deref for Chunk {
4755
type Target = [u8];
4856

0 commit comments

Comments
 (0)