smol/examples/compat-reqwest.rs

12 lines
234 B
Rust
Raw Normal View History

2020-04-15 09:01:03 +00:00
use anyhow::Result;
2020-02-29 21:45:32 +00:00
2020-04-15 09:01:03 +00:00
fn main() -> Result<()> {
2020-04-18 13:29:24 +00:00
smol::run(async {
let resp = reqwest::get("https://www.rust-lang.org").await?;
let body = resp.text().await?;
2020-02-29 21:45:32 +00:00
2020-04-18 13:29:24 +00:00
println!("{:?}", body);
Ok(())
2020-04-15 09:01:03 +00:00
})
2020-02-29 21:45:32 +00:00
}