Upgrade hyper to 0.12

Closes #304
This commit is contained in:
Yash Srivastav
2018-07-05 13:03:31 -04:00
committed by Sean McArthur
parent 7bd3619ece
commit c417d6dab8
27 changed files with 634 additions and 650 deletions

View File

@@ -2,6 +2,7 @@ use std::fmt;
use futures::{Stream, Poll, Async};
use bytes::Bytes;
use hyper::body::Payload;
/// An asynchronous `Stream`.
pub struct Body {
@@ -20,6 +21,13 @@ impl Body {
Inner::Reusable(_) => unreachable!(),
}
}
pub(crate) fn content_length(&self) -> Option<u64> {
match self.inner {
Inner::Reusable(ref bytes) => Some(bytes.len() as u64),
Inner::Hyper(ref body) => body.content_length(),
}
}
}
impl Stream for Body {