-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
A-docsArea: documentation.Area: documentation.E-easyEffort: easy. A task that would be a great starting point for a new contributor.Effort: easy. A task that would be a great starting point for a new contributor.
Description
Version
hyper 0.14(.17)
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;
fn main() {
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
Metadata
Metadata
Assignees
Labels
A-docsArea: documentation.Area: documentation.E-easyEffort: easy. A task that would be a great starting point for a new contributor.Effort: easy. A task that would be a great starting point for a new contributor.