-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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::as_mut_os_string
and Path::as_mut_os_str
#105021
Comments
That seems questionable to me. Right now we don't have any restrictions what goes into a Path, but on some future platform it might be necessary to have a validation on |
On platforms that would need such a restriction, would |
Add `PathBuf::as_mut_os_string` and `Path::as_mut_os_str` Implements rust-lang/libs-team#140 (tracking issue rust-lang#105021).
Add `PathBuf::as_mut_os_string` and `Path::as_mut_os_str` Implements rust-lang/libs-team#140 (tracking issue rust-lang#105021).
PathBuf::as_mut_os_string
and Path::as_mut_os_str
PathBuf::as_mut_os_string
and Path::as_mut_os_str
Stabilization ReportImplementation History
API SummaryA summary of the API is included at the top of this tracking issue. Experience Reportn/a |
@dtolnay, can you please start an FCP? (as per Stabilization PR Checklist) |
@rust-lang/libs-api This stabilizes The point of these methods is illustrated in the documentation examples. They let you mutate the path contents in place without going through path.as_mut_os_string().push("-suffix");
// equivalent to:
let mut os_string = std::mem::take(path).into_os_string();
os_string.push("-suffix");
*path = PathBuf::from(os_string); Note that a |
Team member @dtolnay 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. |
I'm marking yaahc's box because she has stepped down from T-libs-api after the point that this feature got proposed for FCP. |
@Amanieu or @joshtriplett or @m-ou-se? |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
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. |
…tr, r=dtolnay Stabilize path_as_mut_os_str Closes rust-lang#105021 r? `@dtolnay`
…tr, r=dtolnay Stabilize path_as_mut_os_str Closes rust-lang#105021 r? ``@dtolnay``
…tr, r=dtolnay Stabilize path_as_mut_os_str Closes rust-lang#105021 r? ```@dtolnay```
Feature gate:
#![feature(path_as_mut_os_str)]
This is a tracking issue for adding
PathBuf::as_mut_os_string
andPath::as_mut_os_str
(rust-lang/libs-team#140).Public API
Steps / History
PathBuf::as_mut_os_string
andPath::as_mut_os_str
#105002Path::as_mut_os_str
was contrived because one must go throughinto_boxed_path
to get a&mut Path
. ADerefMut
impl makes it possible to demonstrate a more realistic use.Path::as_mut_os_str
doctest #105801Unresolved Questions
Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩
The text was updated successfully, but these errors were encountered: