From 99fc8b45d7ce71377fb992d2ec215eb19bc77ab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20B=C3=BCsch?= Date: Mon, 24 Sep 2018 11:11:44 +1000 Subject: Migrate to serde_json --- src/transport.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/transport.rs') 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::(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 -- cgit v1.2.3