Make the blocking API an optional feature (default off)

This commit is contained in:
Sean McArthur
2019-09-17 15:06:10 -07:00
parent 0a87d3d7da
commit 7e3c1bc461
11 changed files with 71 additions and 49 deletions

View File

@@ -60,7 +60,7 @@ impl Decoder {
/// An empty decoder.
///
/// This decoder will produce a single 0 byte chunk.
#[inline]
#[cfg(feature = "blocking")]
pub(crate) fn empty() -> Decoder {
Decoder {
inner: Inner::PlainText(Body::empty().into_stream()),

View File

@@ -346,6 +346,7 @@ impl Response {
// on the `Response` itself.
//
// This method is just used by the blocking API.
#[cfg(feature = "blocking")]
pub(crate) fn body_mut(&mut self) -> &mut Decoder {
&mut self.body
}