mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-10 00:00:09 +02:00
Fix deprecation warnings
This commit is contained in:
+2
-2
@@ -90,7 +90,7 @@ impl ByteBuf {
|
||||
let cnt = len as u32;
|
||||
|
||||
unsafe {
|
||||
ptr::copy_nonoverlapping_memory(
|
||||
ptr::copy_nonoverlapping(
|
||||
dst.as_mut_ptr(),
|
||||
self.mem.ptr().offset(self.pos as isize), len);
|
||||
}
|
||||
@@ -241,7 +241,7 @@ impl MutByteBuf {
|
||||
#[inline]
|
||||
fn write_ptr(&mut self, src: *const u8, len: u32) -> usize {
|
||||
unsafe {
|
||||
ptr::copy_nonoverlapping_memory(
|
||||
ptr::copy_nonoverlapping(
|
||||
self.buf.mem.ptr().offset(self.buf.pos as isize),
|
||||
src, len as usize);
|
||||
|
||||
|
||||
+2
-2
@@ -75,7 +75,7 @@ pub trait Buf {
|
||||
let src = self.bytes();
|
||||
cnt = cmp::min(src.len(), len - off);
|
||||
|
||||
ptr::copy_nonoverlapping_memory(
|
||||
ptr::copy_nonoverlapping(
|
||||
dst[off..].as_mut_ptr(), src.as_ptr(), cnt);
|
||||
|
||||
off += src.len();
|
||||
@@ -157,7 +157,7 @@ pub trait MutBuf : Sized {
|
||||
let dst = self.mut_bytes();
|
||||
cnt = cmp::min(dst.len(), len - off);
|
||||
|
||||
ptr::copy_nonoverlapping_memory(
|
||||
ptr::copy_nonoverlapping(
|
||||
dst.as_mut_ptr(), src[off..].as_ptr(), cnt);
|
||||
|
||||
off += cnt;
|
||||
|
||||
+2
-2
@@ -99,10 +99,10 @@ impl Clone for RingBuf {
|
||||
let to = self.pos + self.len;
|
||||
|
||||
if to > self.cap {
|
||||
ptr::copy_memory(ret.ptr, self.ptr as *const u8, to % self.cap);
|
||||
ptr::copy(ret.ptr, self.ptr as *const u8, to % self.cap);
|
||||
}
|
||||
|
||||
ptr::copy_memory(
|
||||
ptr::copy(
|
||||
ret.ptr.offset(self.pos as isize),
|
||||
self.ptr.offset(self.pos as isize) as *const u8,
|
||||
cmp::min(self.len, self.cap - self.pos));
|
||||
|
||||
Reference in New Issue
Block a user