1
Fork 0

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.
This commit is contained in:
Josh Stone 2020-03-20 15:46:40 -07:00
parent b80fa76ee0
commit f854070bb8
4 changed files with 13 additions and 2 deletions

View file

@ -173,6 +173,10 @@ impl Slice {
Buf { inner: self.inner.to_vec() }
}
pub fn clone_into(&self, buf: &mut Buf) {
self.inner.clone_into(&mut buf.inner)
}
#[inline]
pub fn into_box(&self) -> Box<Slice> {
let boxed: Box<[u8]> = self.inner.into();