You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
In the documentation, it is not clear that the function Client::new needs the tcp feature enable, otherwise it would throw an function not found error
Example
Cargo.toml:
[package]
name = "hyper_test"version = "0.1.0"edition = "2021"# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
hyper = { version = "0.14", features = ["client", "http1", "http2"] }
main.rs:
use hyper::client::Client;fnmain(){let client = Client::new();}
output:
error[E0599]: no function or associated item named `new` found for struct `Client` in the current scope
--> src/main.rs:4:26
|
4 | let client = Client::new();
| ^^^ function or associated item not found in `Client<_, _>`
For more information about this error, try `rustc --explain E0599`.
error: could not compile `hyper_test` due to previous error
The text was updated successfully, but these errors were encountered:
Ah ok, seems like we can add a doc(cfg(tcp)) to that function.
seanmonstar
added
A-docs
Area: documentation.
E-easy
Effort: easy. A task that would be a great starting point for a new contributor.
and removed
C-bug
Category: bug. Something is wrong. This is bad!
labels
Feb 14, 2022
Version
hyper 0.14(.17)
Description
In the documentation, it is not clear that the function
Client::new
needs thetcp
feature enable, otherwise it would throw an function not found errorExample
Cargo.toml:
main.rs:
output:
The text was updated successfully, but these errors were encountered: