reduce size of Response, async::Response, and async::Decoder
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use std::fmt;
|
||||
|
||||
use futures::{Stream, Poll, Async};
|
||||
use bytes::Bytes;
|
||||
use bytes::{Buf, Bytes};
|
||||
use hyper::body::Payload;
|
||||
|
||||
/// An asynchronous `Stream`.
|
||||
@@ -88,6 +88,20 @@ pub struct Chunk {
|
||||
inner: ::hyper::Chunk,
|
||||
}
|
||||
|
||||
impl Buf for Chunk {
|
||||
fn bytes(&self) -> &[u8] {
|
||||
self.inner.bytes()
|
||||
}
|
||||
|
||||
fn remaining(&self) -> usize {
|
||||
self.inner.remaining()
|
||||
}
|
||||
|
||||
fn advance(&mut self, n: usize) {
|
||||
self.inner.advance(n);
|
||||
}
|
||||
}
|
||||
|
||||
impl AsRef<[u8]> for Chunk {
|
||||
#[inline]
|
||||
fn as_ref(&self) -> &[u8] {
|
||||
|
||||
Reference in New Issue
Block a user