From f5567db4dcc04a769725d0b9ccb6a81bc3026acc Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Mon, 1 May 2017 11:53:10 -0700 Subject: [PATCH] feat(http): implement `Default` for `Chunk` This allows using `Stream::concat2` with a `hyper::Body`. --- src/http/chunk.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/http/chunk.rs b/src/http/chunk.rs index ec0b3d5e6f..bd404b0725 100644 --- a/src/http/chunk.rs +++ b/src/http/chunk.rs @@ -109,6 +109,13 @@ impl fmt::Debug for Chunk { } } +impl Default for Chunk { + #[inline] + fn default() -> Chunk { + Chunk(Inner::Shared(Bytes::new())) + } +} + impl IntoIterator for Chunk { type Item = u8; type IntoIter = ::IntoIter;