-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking Issue for PathBuf::add_extension and Path::with_added_extension #127292
Comments
This would be really awesome honestly, just encountered an issue where this would have made my life easier. |
Hoping this becomes available in stable soon. Such a nice QoL api. |
This new API is awesome! But I think It would be better to rename (deprecate old and add new name) existing API Actually I mistakenly used |
I agree with the rename however we can only do that with a new edition (since |
I don't think edition change is required since we don't have to actually rename the function. I think there are some cases that deprecating without edition change like deprecate _ms functions with |
Starting an FCP to stabilize this: @rfcbot merge |
Team member @joshtriplett has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), 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. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
Some late bikeshed: the name impl Path {
pub fn join<P: AsRef<Path>>(&self, path: P) -> PathBuf;
pub fn join_extension<S: AsRef<OsStr>>(&self, extension: S) -> PathBuf;
}
impl PathBuf {
pub fn push<P: AsRef<Path>>(&mut self, path: P);
pub fn push_extension<S: AsRef<OsStr>>(&mut self, extension: S) -> bool;
} |
FYI the naming discussion also happened in the ACP period - rust-lang/libs-team#368 (comment) |
We discussed this in the libs-api meeting. There was a slight preference towards keeping the "add"-based names since it is consistent with |
This API currently seems to have the same issue as This API should probably panic as well if the passed extension contains a path separator. |
Additional, but much less important point: The This is exemplified in the |
Alternatively, the function could just be annotated with |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
Feature gate:
#![feature(path_add_extension)]
This is a tracking issue for
PathBuf::add_extension
Path::with_added_extension
Public API
Steps / History
Unresolved Questions
None yet.
Footnotes
The text was updated successfully, but these errors were encountered: