From fac3d70c0b716157ba689ae2b8a0089b6afc9bdc Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Wed, 1 Mar 2017 16:59:36 -0800 Subject: [PATCH] feat(http): add Into for Chunk --- src/http/chunk.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/http/chunk.rs b/src/http/chunk.rs index 5e2216f3d7..512268aa3f 100644 --- a/src/http/chunk.rs +++ b/src/http/chunk.rs @@ -43,6 +43,14 @@ impl From for Chunk { } } +impl From for Bytes { + fn from(chunk: Chunk) -> Bytes { + match self.0 { + Inner::Shared(bytes) => bytes, + } + } +} + impl ::std::ops::Deref for Chunk { type Target = [u8];