diff options
author | Antoine Büsch <antoine.busch@gmail.com> | 2018-09-24 11:11:44 +1000 |
---|---|---|
committer | Antoine Büsch <antoine.busch@gmail.com> | 2018-10-01 11:54:36 +1000 |
commit | 99fc8b45d7ce71377fb992d2ec215eb19bc77ab1 (patch) | |
tree | c5ee851ec5e9fbeff158817073e36c696421a416 /src/transport.rs | |
parent | 7fb4ea5098fe7a47903d3ca7fab80561a69ddc32 (diff) |
Migrate to serde_json
Diffstat (limited to 'src/transport.rs')
-rw-r--r-- | src/transport.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/transport.rs b/src/transport.rs index 4cd0a96..0b52b60 100644 --- a/src/transport.rs +++ b/src/transport.rs @@ -16,7 +16,7 @@ use hyperlocal::UnixConnector; #[cfg(feature = "unix-socket")] use hyperlocal::Uri as DomainUri; use mime::Mime; -use rustc_serialize::json; +use serde_json::{self, Value}; use std::cell::{RefCell, RefMut}; use std::fmt; use std::io::Read; @@ -214,12 +214,12 @@ impl Transport { match String::from_utf8(chunk.into_iter().collect()) { Ok(output) => { - let json_response = json::Json::from_str(output.as_str()).ok(); + let json_response = serde_json::from_str::<Value>(output.as_str()).ok(); let message = json_response .as_ref() .and_then(|x| x.as_object()) .and_then(|x| x.get("message")) - .and_then(|x| x.as_string()) + .and_then(|x| x.as_str()) .map(|x| x.to_owned()); message |