-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.
Description
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:
self.slice.fill(0);
lilith, Addisonbean, MrBuddyCasino, leonardo-m, jleni and 18 more
Metadata
Metadata
Assignees
Labels
T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.