This commit is contained in:
Nikolay Kim 2023-09-05 15:49:49 +06:00
parent d06fded946
commit 19cc8ab315
9 changed files with 22 additions and 36 deletions

View file

@ -187,7 +187,7 @@ pub trait BufMut {
let d = self.chunk_mut();
l = cmp::min(s.len(), d.len());
ptr::copy_nonoverlapping(s.as_ptr(), d.as_mut_ptr() as *mut u8, l);
ptr::copy_nonoverlapping(s.as_ptr(), d.as_mut_ptr(), l);
}
src.advance(l);
@ -228,11 +228,7 @@ pub trait BufMut {
let dst = self.chunk_mut();
cnt = cmp::min(dst.len(), src.len() - off);
ptr::copy_nonoverlapping(
src[off..].as_ptr(),
dst.as_mut_ptr() as *mut u8,
cnt,
);
ptr::copy_nonoverlapping(src[off..].as_ptr(), dst.as_mut_ptr(), cnt);
off += cnt;
}

View file

@ -1607,11 +1607,7 @@ impl BufMut for BytesMut {
self.reserve(len);
unsafe {
ptr::copy_nonoverlapping(
src.as_ptr(),
self.chunk_mut().as_mut_ptr() as *mut u8,
len,
);
ptr::copy_nonoverlapping(src.as_ptr(), self.chunk_mut().as_mut_ptr(), len);
self.advance_mut(len);
}
}
@ -2418,11 +2414,7 @@ impl BufMut for BytesVec {
self.reserve(len);
unsafe {
ptr::copy_nonoverlapping(
src.as_ptr(),
self.chunk_mut().as_mut_ptr() as *mut u8,
len,
);
ptr::copy_nonoverlapping(src.as_ptr(), self.chunk_mut().as_mut_ptr(), len);
self.advance_mut(len);
}
}