Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Fixed Index trait and new PathBuf::new() #85

Merged
merged 2 commits into from
Mar 25, 2015

Conversation

Kintaro
Copy link
Contributor

@Kintaro Kintaro commented Mar 25, 2015

No description provided.

@rust-highfive
Copy link

r? @huonw

(rust_highfive has picked a reviewer for you, use r? to override)

@huonw
Copy link
Contributor

huonw commented Mar 25, 2015

r? @alexcrichton (can't handle this at the moment)

@rust-highfive rust-highfive assigned alexcrichton and unassigned huonw Mar 25, 2015
@alexcrichton
Copy link
Contributor

Thanks! We'll be sure to merge this once there's a new nightly available

@@ -570,14 +570,18 @@ impl Decodable for path::PathBuf {
use std::os::unix::prelude::*;
let bytes: Vec<u8> = try!(Decodable::decode(d));
let s: OsString = OsStringExt::from_vec(bytes);
Ok(path::PathBuf::new(&s))
let mut p = path::PathBuf::new();
p.push(s);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit unsure about this part. I hate mut. Might it be better to use FromIterator here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh this can actually just be replaced with Ok(PathBuf::from(s))

@Kintaro
Copy link
Contributor Author

Kintaro commented Mar 25, 2015

Ah ok, didn't know about from. Changed it now.

alexcrichton added a commit that referenced this pull request Mar 25, 2015
Fixed Index trait and new PathBuf::new()
@alexcrichton alexcrichton merged commit 7fa5383 into rust-lang-deprecated:master Mar 25, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants