async/reponse: return a impl Future on json()
This commit is contained in:
committed by
Sean McArthur
parent
7eae51f56e
commit
5e38b419f0
@@ -127,7 +127,7 @@ impl Response {
|
|||||||
|
|
||||||
/// Try to deserialize the response body as JSON using `serde`.
|
/// Try to deserialize the response body as JSON using `serde`.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn json<T: DeserializeOwned>(&mut self) -> Json<T> {
|
pub fn json<T: DeserializeOwned>(&mut self) -> impl Future<Item = T, Error = ::Error> {
|
||||||
let body = mem::replace(&mut self.body, Decoder::empty());
|
let body = mem::replace(&mut self.body, Decoder::empty());
|
||||||
|
|
||||||
Json {
|
Json {
|
||||||
|
|||||||
Reference in New Issue
Block a user