Skip to content

Commit

Permalink
Use .cast() instead of "as *mut _"
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeier committed Jul 6, 2023
1 parent 2e01e71 commit 20d8e56
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/chunks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,8 @@ impl<T> WriteChunkUninit<'_, T> {
pub fn as_mut_slices(&mut self) -> (&mut [MaybeUninit<T>], &mut [MaybeUninit<T>]) {
unsafe {
(
core::slice::from_raw_parts_mut(self.first_ptr as *mut _, self.first_len),
core::slice::from_raw_parts_mut(self.second_ptr as *mut _, self.second_len),
core::slice::from_raw_parts_mut(self.first_ptr.cast(), self.first_len),
core::slice::from_raw_parts_mut(self.second_ptr.cast(), self.second_len),
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ impl<T: Copy> CopyToUninit<T> for [T] {
dst.len(),
"source slice length does not match destination slice length"
);
let dst_ptr = dst.as_mut_ptr() as *mut _;
let dst_ptr = dst.as_mut_ptr().cast();
unsafe {
self.as_ptr().copy_to_nonoverlapping(dst_ptr, self.len());
core::slice::from_raw_parts_mut(dst_ptr, self.len())
Expand Down

0 comments on commit 20d8e56

Please sign in to comment.