Examples on `hyper::client::connect` do not compile
Open
Nobody has claimed this yet.
A-client
A-docs
E-easy
- Dominant language
- Rust
- Stars
- 16.3k
- Forks
- 1.8k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 14
Description
I'm trying to replicate the example with service_fn in https://docs.rs/hyper/0.13.3/hyper/client/connect/index.html, but I'm unable to get this example to compile:
let connector = service_fn(|_: http::Uri| async {
tokio::net::TcpStream::connect("127.0.0.1:1337")
});
let mut client = hyper::Client::builder().build(connector);
Here's a minimal reproduction: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=2a85ed2fb9b1025826e81243f72c9fc0.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the hyper::client::connect example at the linked docs.rs page and run the linked Rust Playground reproduction first. Compare the example with the compiler output; done when the documented service_fn example compiles on the stated edition and toolchain.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100