summaryrefslogtreecommitdiffstats
path: root/library/std/src/sys/windows/os_str.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/std/src/sys/windows/os_str.rs')
-rw-r--r--library/std/src/sys/windows/os_str.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/library/std/src/sys/windows/os_str.rs b/library/std/src/sys/windows/os_str.rs
index 11883f150..4bdd8c505 100644
--- a/library/std/src/sys/windows/os_str.rs
+++ b/library/std/src/sys/windows/os_str.rs
@@ -164,9 +164,7 @@ impl Slice {
}
pub fn to_owned(&self) -> Buf {
- let mut buf = Wtf8Buf::with_capacity(self.inner.len());
- buf.push_wtf8(&self.inner);
- Buf { inner: buf }
+ Buf { inner: self.inner.to_owned() }
}
pub fn clone_into(&self, buf: &mut Buf) {