From ef2957de137fb8d6959310e5d8f2fa1d600d7d36 Mon Sep 17 00:00:00 2001 From: TyPR124 Date: Mon, 16 Mar 2020 13:13:07 -0400 Subject: allowing getting &mut OsStr from OsString --- src/libstd/sys/windows/os_str.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/libstd/sys/windows') diff --git a/src/libstd/sys/windows/os_str.rs b/src/libstd/sys/windows/os_str.rs index ef260f9c5d2..4cff23b2f4a 100644 --- a/src/libstd/sys/windows/os_str.rs +++ b/src/libstd/sys/windows/os_str.rs @@ -80,6 +80,11 @@ impl Buf { unsafe { mem::transmute(self.inner.as_slice()) } } + #[inline] + pub fn as_mut_slice(&mut self) -> &mut Slice { + unsafe { mem::transmute(self.inner.as_mut_slice()) } + } + pub fn into_string(self) -> Result { self.inner.into_string().map_err(|buf| Buf { inner: buf }) } -- cgit 1.4.1-3-g733a5