Sync Response::text() & Response::json() call their async version
This commit is contained in:
@@ -142,14 +142,6 @@ impl Decoder {
|
||||
Decoder::plain_text(body)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pub(crate) fn content_length(&self) -> Option<u64> {
|
||||
match self.inner {
|
||||
Inner::PlainText(ref body) => body.content_length(),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Stream for Decoder {
|
||||
|
||||
@@ -271,7 +271,7 @@ impl<T: Into<Body>> From<http::Response<T>> for Response {
|
||||
}
|
||||
|
||||
/// A JSON object.
|
||||
pub struct Json<T> {
|
||||
struct Json<T> {
|
||||
concat: Concat2<Decoder>,
|
||||
_marker: PhantomData<T>,
|
||||
}
|
||||
@@ -294,7 +294,7 @@ impl<T> fmt::Debug for Json<T> {
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Text {
|
||||
struct Text {
|
||||
concat: Concat2<Decoder>,
|
||||
encoding: &'static Encoding,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user