Skip to content

Commit f86caf8

Browse files
committed
Revert "changed to PathBuf::from and added convert feature"
This reverts commit db777e8. Conflicts: src/lib.rs
1 parent bf1ad07 commit f86caf8

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
//! Support code for encoding and decoding types.
1212
13-
#![feature(convert)]
1413
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
1514
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
1615
html_root_url = "http://doc.rust-lang.org/rustc-serialize/")]

src/serialize.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,14 +570,18 @@ impl Decodable for path::PathBuf {
570570
use std::os::unix::prelude::*;
571571
let bytes: Vec<u8> = try!(Decodable::decode(d));
572572
let s: OsString = OsStringExt::from_vec(bytes);
573-
Ok(path::PathBuf::from(s))
573+
let mut p = path::PathBuf::new();
574+
p.push(s);
575+
Ok(p)
574576
}
575577
#[cfg(windows)]
576578
fn decode<D: Decoder>(d: &mut D) -> Result<path::PathBuf, D::Error> {
577579
use std::os::windows::prelude::*;
578580
let bytes: Vec<u16> = try!(Decodable::decode(d));
579581
let s: OsString = OsStringExt::from_wide(&bytes);
580-
Ok(path::PathBuf::from(s))
582+
let mut p = PathBuf::new();
583+
p.push(s);
584+
Ok(p)
581585
}
582586
}
583587

0 commit comments

Comments
 (0)