diff --git a/Cargo.toml b/Cargo.toml index d3fe77a..1008a09 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,4 +15,4 @@ support for hex, base64, and json encoding and decoding. """ [dev-dependencies] -rand = "0.2" +rand = "0.3" diff --git a/src/lib.rs b/src/lib.rs index 7a871ce..17a6b54 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,7 +10,6 @@ //! Support code for encoding and decoding types. -#![feature(convert)] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", html_root_url = "http://doc.rust-lang.org/rustc-serialize/")] diff --git a/src/serialize.rs b/src/serialize.rs index 9b2ca99..8f44a64 100644 --- a/src/serialize.rs +++ b/src/serialize.rs @@ -570,14 +570,18 @@ impl Decodable for path::PathBuf { use std::os::unix::prelude::*; let bytes: Vec = try!(Decodable::decode(d)); let s: OsString = OsStringExt::from_vec(bytes); - Ok(path::PathBuf::from(s)) + let mut p = path::PathBuf::new(); + p.push(s); + Ok(p) } #[cfg(windows)] fn decode(d: &mut D) -> Result { use std::os::windows::prelude::*; let bytes: Vec = try!(Decodable::decode(d)); let s: OsString = OsStringExt::from_wide(&bytes); - Ok(path::PathBuf::from(s)) + let mut p = PathBuf::new(); + p.push(s); + Ok(p) } }