You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dirstat/src/bytes.rs

13 lines
405 B

//! Dealing with bytes and stuff
/// Copy from `src` into `dst` and return the number of bytes copied.
///
/// # Notes
/// The regions *must not* overlap. This is UB if they do.
#[inline] pub unsafe fn copy_nonoverlapping_unchecked(src: &[u8], dst: &mut [u8]) -> usize
{
let len = std::cmp::min(dst.len(), src.len());
std::ptr::copy_nonoverlapping(src.as_ptr(), dst.as_mut_ptr(), len);
len
}