Add note about how to use tokio::main in examples (#745)
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
#![deny(warnings)]
|
||||
|
||||
// This is using the `tokio` runtime. You'll need the following dependency:
|
||||
//
|
||||
// `tokio = { version = "0.2", features = ["macros"] }`
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), reqwest::Error> {
|
||||
let res = reqwest::Client::new()
|
||||
.get("https://hyper.rs")
|
||||
.send()
|
||||
.await?;
|
||||
let res = reqwest::get("https://hyper.rs").await?;
|
||||
|
||||
println!("Status: {}", res.status());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user