Uh oh!
There was an error while loading. Please reload this page.
Added Default impl to PathBuf - #38764
Conversation
rust-highfive
commented
Jan 1, 2017
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @sfackler (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
GuillaumeGomez
commented
Jan 4, 2017
👍 |
sfackler
commented
Jan 4, 2017
@rfcbot fcp merge |
Team member @sfackler has proposed to merge this. The next step is review by the rest of the tagged teams: Concerns:
Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
brson
commented
Jan 6, 2017
I feel like we've discussed this before and decided not to have a default for paths because it's not clear what it means to be a 'default' path. This implementation I think creates an empty path, but semantically that does not strike me as a 'default path', it strikes me more like a null path and a source of errors. |
brson
commented
Jan 6, 2017
@rfcbot concern there's no obvious default for paths per above |
aturon
commented
Jan 6, 2017
@brson Yes, I believe this came up for |
sfackler
commented
Jan 10, 2017
A generally good rule of thumb is that if a type has a no-arg |
clarfonthey
commented
Jan 10, 2017
sfackler
commented
Jan 17, 2017
@brson ping? |
clarfonthey
commented
Jan 17, 2017
Also note that this has precedent in Iterator::unzip which requires Default. |
brson
commented
Jan 20, 2017
And you would use default for that, not new? |
brson
commented
Jan 20, 2017
I don't quite follow how that is precedent for Path::default. |
brson
commented
Jan 20, 2017
I'm afraid I still don't see any obvious motivation here except for @sfackler's rule of thumb that types that implement |
clarfonthey
commented
Jan 20, 2017
@brson: the Empty strings might not be a reasonable default for a lot of containers too, but that's the way stdlib seems to point. |
BurntSushi
commented
Jan 23, 2017
I feel like this is a pretty good point. Paths have additional semantics in the environment that strings don't have. I don't feel strongly either way on this given @brson's concerns. It does feel like a possible footgun, but I think adding a |
aturon
commented
Jan 23, 2017
I agree with @brson that there's a potential footgun here, but I think it's relatively minor, and OTOH not being able to work easily with things like |
XAMPPRocky
commented
Jan 23, 2017
@brson I'm not really sure if I see the footgun. What errors could arise from the PathBuf that wouldn't already have to be handled by the user? |
tbu-
commented
Jan 28, 2017
See also #32990. The empty path makes sense for both |
aturon
commented
Jan 31, 2017
Ping @brson, are you satisfied by the recent arguments? |
brson
commented
Feb 6, 2017
@aturon No, but I clicked the box anyway. |
aturon
commented
Feb 6, 2017
Thanks all, and thanks @Aaronepower for sticking in there! @bors: r+ rollup |
bors
commented
Feb 6, 2017
📌 Commit 108293d has been approved by |
Added Default impl to PathBuf
Added Default impl to PathBuf
Added Default impl to PathBuf
Added Default impl to PathBuf
No description provided.