Merge into_json_deserialize into into_json.

This commit is contained in:
Jacob Hoffman-Andrews
2020-11-21 15:47:49 -08:00
parent 4cb856196e
commit 271e650662
4 changed files with 43 additions and 50 deletions

View File

@@ -138,9 +138,9 @@ fn overall_timeout_reading_json() {
let timeout = Duration::from_millis(500);
let agent = builder().timeout(timeout).build();
let resp = agent.get(&url).call().unwrap();
let result: Result<serde_json::Value, io::Error> = agent.get(&url).call().unwrap().into_json();
match resp.into_json() {
match result {
Ok(_) => Err("successful response".to_string()),
Err(e) => match e.kind() {
io::ErrorKind::TimedOut => Ok(()),