Closed
Description
Feature gate: #![feature(path_as_mut_os_str)]
This is a tracking issue for adding PathBuf::as_mut_os_string
and Path::as_mut_os_str
(rust-lang/libs-team#140).
Public API
impl PathBuf {
// ...
pub fn as_mut_os_string(&mut self) -> &mut OsString {
&mut self.inner
}
// ...
}
impl Path {
// ...
pub fn as_mut_os_str(&mut self) -> &mut OsStr {
&mut self.inner
}
// ...
}
Steps / History
- Implementation: Add
PathBuf::as_mut_os_string
andPath::as_mut_os_str
#105002 - Implement DerefMut for PathBuf #105018: the initial example for
Path::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. - Realistic
Path::as_mut_os_str
doctest #105801 - Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- None yet.