diff --git a/Cargo.toml b/Cargo.toml index 9ae1c38b..a8ccd875 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,8 +28,9 @@ bufstream = "0.1" byteorder = ">= 0.3, < 0.5" log = "0.3" phf = "0.7" -rustc-serialize = "0.3" +hex = "0.1" net2 = { version = "0.2", features = ["nightly"] } +rustc-serialize = { version = "0.3", optional = true } chrono = { version = "0.2.14", optional = true } openssl = { version = ">= 0.6.4, < 0.8", optional = true } serde = { version = "0.3", optional = true } # Delete for 0.11 diff --git a/src/lib.rs b/src/lib.rs index 6a67efeb..7085f2c1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -46,10 +46,10 @@ extern crate bufstream; extern crate byteorder; +extern crate hex; #[macro_use] extern crate log; extern crate phf; -extern crate rustc_serialize as serialize; #[cfg(feature = "unix_socket")] extern crate unix_socket; extern crate net2; diff --git a/src/md5.rs b/src/md5.rs index d497847c..64a67c41 100644 --- a/src/md5.rs +++ b/src/md5.rs @@ -477,11 +477,11 @@ impl Md5 { } pub fn result_str(&mut self) -> String { - use serialize::hex::ToHex; + use hex::ToHex; let mut buf: Vec = repeat(0).take((self.output_bits() + 7) / 8).collect(); self.result(&mut buf); - buf[..].to_hex() + buf.to_hex() } } diff --git a/src/types/rustc_serialize.rs b/src/types/rustc_serialize.rs index fb171fbb..5c9a27e5 100644 --- a/src/types/rustc_serialize.rs +++ b/src/types/rustc_serialize.rs @@ -1,4 +1,6 @@ -use serialize::json; +extern crate rustc_serialize; + +use self::rustc_serialize::json; use std::error; use std::io::prelude::*; use byteorder::{ReadBytesExt, WriteBytesExt}; diff --git a/src/url.rs b/src/url.rs index 192778b5..7f8e9590 100644 --- a/src/url.rs +++ b/src/url.rs @@ -10,7 +10,7 @@ use std::io::prelude::*; use std::str::FromStr; use std::str; -use serialize::hex::FromHex; +use hex::FromHex; pub struct Url { pub scheme: String, @@ -133,7 +133,7 @@ fn decode_inner(c: &str, full_url: bool) -> DecodeResult { }; // Only decode some characters if full_url: - match str::from_utf8(&bytes).unwrap().from_hex().unwrap()[0] as char { + match Vec::::from_hex(str::from_utf8(&bytes).unwrap()).unwrap()[0] as char { // gen-delims: ':' | '/' | diff --git a/tests/test.rs b/tests/test.rs index 7ce3ed76..d90bba7d 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -1,5 +1,4 @@ extern crate postgres; -extern crate rustc_serialize as serialize; extern crate url; #[cfg(feature = "openssl")] extern crate openssl; diff --git a/tests/types/rustc_serialize.rs b/tests/types/rustc_serialize.rs index 898b93b3..81f962cf 100644 --- a/tests/types/rustc_serialize.rs +++ b/tests/types/rustc_serialize.rs @@ -1,4 +1,6 @@ -use serialize::json::Json; +extern crate rustc_serialize; + +use self::rustc_serialize::json::Json; use types::test_type;