remove unsafe copy code
copy_nonoverlapping is basically a memcpy which can also be done via copy_from_slice which is not unsafe (copy_from_slice uses copy_nonoverlapping internally) Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
3352ee5656
commit
bde8e243cf
|
@ -363,9 +363,7 @@ impl<S: ReadChunk> std::io::Read for BufferedDynamicReader<S> {
|
|||
data.len()
|
||||
};
|
||||
|
||||
unsafe {
|
||||
std::ptr::copy_nonoverlapping(data.as_ptr(), buf.as_mut_ptr(), n);
|
||||
}
|
||||
buf[0..n].copy_from_slice(&data[0..n]);
|
||||
|
||||
self.read_offset += n as u64;
|
||||
|
||||
|
|
Loading…
Reference in New Issue