Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update doc tests of client to async/await #1867

Closed
wants to merge 3 commits into from
Closed

Update doc tests of client to async/await #1867

wants to merge 3 commits into from

Conversation

weihanglo
Copy link
Contributor

@weihanglo weihanglo commented Jul 13, 2019

What

Reference #1850

  • Remove unnecessary extern crate.
  • Remove unnecessary import such as futures::Future, hyper::rt::Future.
  • Use async fn and await syntax instead of futures operators.

How to test

  • Run cargo doc --open to check if examples are rendered properly.
  • Run cargo test --doc -- src/client. It should output something like
running 10 tests
test src/client/conn.rs - client::conn::SendRequest<B>::send_request (line 193) ... ok
test src/client/connect/mod.rs - client::connect::Destination::set_port (line 172) ... ok
test src/client/connect/mod.rs - client::connect::Destination::set_host (line 131) ... ok
test src/client/connect/http.rs - client::connect::http::HttpInfo (line 48) ... ok
test src/client/mod.rs - client::Client<(), Body>::builder (line 140) ... ok
test src/client/mod.rs - client::Builder (line 824) ... ok
test src/client/connect/mod.rs - client::connect::Destination::set_scheme (line 104) ... ok
test src/client/mod.rs - client (line 29) ... ok
test src/client/mod.rs - client::Client<C, B>::get (line 178) ... ok
test src/client/mod.rs - client::Client<C, B>::request (line 208) ... ok

@weihanglo weihanglo changed the title Update doc tests of service to async/await Update doc tests of client to async/await Jul 13, 2019
@weihanglo weihanglo mentioned this pull request Jul 14, 2019
2 tasks
@weihanglo weihanglo closed this Jul 14, 2019
@weihanglo weihanglo deleted the doc-tests/client branch July 19, 2019 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant