From 2d4348927880c873bbe59af66ae7d3cd689a178e Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Mon, 1 Apr 2019 17:53:30 -0700 Subject: [PATCH] ClientRequest::json() accepts reference instead of object --- awc/CHANGES.md | 2 ++ awc/src/request.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/awc/CHANGES.md b/awc/CHANGES.md index 4ae63493e..cd9635074 100644 --- a/awc/CHANGES.md +++ b/awc/CHANGES.md @@ -16,6 +16,8 @@ * Use non-consuming builder pattern for `ClientRequest`. +* `ClientRequest::json()` accepts reference instead of object. + * `ClientResponse::body()` does not consume response object. diff --git a/awc/src/request.rs b/awc/src/request.rs index 807a28978..78404b31b 100644 --- a/awc/src/request.rs +++ b/awc/src/request.rs @@ -499,7 +499,7 @@ impl ClientRequest { /// Set a JSON body and generate `ClientRequest` pub fn send_json( &mut self, - value: T, + value: &T, ) -> impl Future< Item = ClientResponse>, Error = SendRequestError,