use README.md traits to use dynamic library (#695)

This commit is contained in:
Moses Gathuku
2019-10-30 22:40:49 +03:00
committed by Sean McArthur
parent 3090a68d53
commit 57300edbc4

View File

@@ -26,7 +26,7 @@ Async:
use std::collections::HashMap;
#[tokio::main]
async fn main() -> Result<(), Box<std::error::Error>> {
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let resp: HashMap<String, String> = reqwest::get("https://httpbin.org/ip")
.await?
.json()
@@ -41,7 +41,7 @@ Blocking:
```rust,no_run
use std::collections::HashMap;
fn main() -> Result<(), Box<std::error::Error>> {
fn main() -> Result<(), Box<dyn std::error::Error>> {
let resp: HashMap<String, String> = reqwest::blocking::get("https://httpbin.org/ip")?
.json()?;
println!("{:#?}", resp);