Fix bugs in README example (#441)

Fix missing > in method return signature, undeclared variable, and
adds return type to match method signature.
This commit is contained in:
puffybsd
2019-01-16 00:23:41 -05:00
committed by Sean McArthur
parent 94535ece88
commit 56c1c02b84

View File

@@ -20,10 +20,11 @@ extern crate reqwest;
use std::collections::HashMap; use std::collections::HashMap;
fn main() -> Result<(), Box<std::error::Error> { fn main() -> Result<(), Box<std::error::Error>> {
let res: HashMap<String, String> = reqwest::get("https://httpbin.org/ip")? let resp: HashMap<String, String> = reqwest::get("https://httpbin.org/ip")?
.json()?; .json()?;
println!("{:#?}", resp); println!("{:#?}", resp);
Ok(())
} }
``` ```