From 4f4acbd72784097806bfd932cda18d66ec4c3698 Mon Sep 17 00:00:00 2001 From: henrylee2cn Date: Thu, 4 Apr 2019 14:38:07 +0800 Subject: [PATCH] fix: send_json(data) -> send_json(&data) --- async_ex1/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/async_ex1/src/main.rs b/async_ex1/src/main.rs index a9eb054b..30af79ed 100644 --- a/async_ex1/src/main.rs +++ b/async_ex1/src/main.rs @@ -61,7 +61,7 @@ fn step_x_v1( Box::new( client .post("https://httpbin.org/post") - .send_json(data) + .send_json(&data) .map_err(Error::from) // <- convert SendRequestError to an Error .and_then(|resp| { resp // <- this is MessageBody type, resolves to complete body @@ -108,7 +108,7 @@ fn step_x_v2( ) -> impl Future { client .post("https://httpbin.org/post") - .send_json(data) + .send_json(&data) .map_err(Error::from) // <- convert SendRequestError to an Error .and_then(|resp| { resp.from_err()