diff options
| author | Josh Stone <jistone@redhat.com> | 2020-03-20 15:46:40 -0700 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2020-04-06 18:26:37 -0700 |
| commit | f854070bb820501d88d1b029660bfde663595530 (patch) | |
| tree | 834344f0f196a8aa8733510370c63201fc895fac /src/libstd/sys | |
| parent | b80fa76ee0a160fffa04e337b8e33ef655a80649 (diff) | |
| download | rust-f854070bb820501d88d1b029660bfde663595530.tar.gz rust-f854070bb820501d88d1b029660bfde663595530.zip | |
Forward OsStr::clone_into to the inner Vec
Despite OS differences, they're all just `Vec<u8>` inside, so we can just forward `clone_into` calls to that optimized implementation.
Diffstat (limited to 'src/libstd/sys')
| -rw-r--r-- | src/libstd/sys/windows/os_str.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libstd/sys/windows/os_str.rs b/src/libstd/sys/windows/os_str.rs index 6aab028873e..2f5fc72ab44 100644 --- a/src/libstd/sys/windows/os_str.rs +++ b/src/libstd/sys/windows/os_str.rs @@ -159,6 +159,10 @@ impl Slice { Buf { inner: buf } } + pub fn clone_into(&self, buf: &mut Buf) { + self.inner.clone_into(&mut buf.inner) + } + #[inline] pub fn into_box(&self) -> Box<Slice> { unsafe { mem::transmute(self.inner.into_box()) } |
