feat(http): implement Default for Chunk

This allows using `Stream::concat2` with a `hyper::Body`.
This commit is contained in:
Sean McArthur
2017-05-01 11:53:10 -07:00
parent 154ab29c0d
commit f5567db4dc

View File

@@ -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 = <Bytes as IntoIterator>::IntoIter;