RFC 1419 implemented safe memcpy but not memset.
It would be awesome if we could fill slices with data in a safe manner that would lower into memset.
Currently if I want to fill a slice with memset semantics I have to do this:
unsafe {
ptr::write_bytes(self.slice.as_mut_ptr(), 0, self.slice.len() - 1);
}
I would like to be able to do something like this:
RFC 1419 implemented safe
memcpybut notmemset.It would be awesome if we could fill slices with data in a safe manner that would lower into
memset.Currently if I want to fill a slice with
memsetsemantics I have to do this:I would like to be able to do something like this: