diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-04-07 14:46:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-07 14:46:53 +0200 |
| commit | 795bc2ccff5672389c1e9d2481f25bdcdfee299b (patch) | |
| tree | 102f79b2bf4261484fb3354568a648c92c2fc2ae /src/libstd/sys | |
| parent | 39b62533c7f9d0581a6ea9b9fc2cc51f21c3b5b0 (diff) | |
| parent | f854070bb820501d88d1b029660bfde663595530 (diff) | |
| download | rust-795bc2ccff5672389c1e9d2481f25bdcdfee299b.tar.gz rust-795bc2ccff5672389c1e9d2481f25bdcdfee299b.zip | |
Rollup merge of #70201 - cuviper:clone_into, r=dtolnay
Small tweaks in ToOwned::clone_into - `<[T]>::clone_into` is slightly more optimized. - `CStr::clone_into` is new, letting it reuse its allocation. - `OsStr::clone_into` now forwards to the underlying slice/`Vec`.
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()) } |
