1
0
mirror of https://github.com/actix/examples synced 2025-01-22 22:05:57 +01:00

fix: send_json(data) -> send_json(&data)

This commit is contained in:
henrylee2cn 2019-04-04 14:38:07 +08:00 committed by GitHub
parent 6dccd567db
commit 4f4acbd727
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<Item = SomeData, Error = Error> {
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()