redundant pointer casts

This commit is contained in:
Folkert 2023-11-18 22:48:00 +01:00
parent 49c2b1dbb7
commit 4fb3e90451
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C

View file

@ -82,7 +82,7 @@ impl<'a> Src64<'a> {
} }
// Safety: we got capacity by rounding up to the nearest 64B // Safety: we got capacity by rounding up to the nearest 64B
let dest = unsafe { allocate_chunks(arena, capacity)? }.as_ptr() as *mut u8; let dest = unsafe { allocate_chunks(arena, capacity)? }.as_ptr();
// Safety: `dest` has a length of `capacity`, which has been rounded up to a multiple of 64. // Safety: `dest` has a length of `capacity`, which has been rounded up to a multiple of 64.
unsafe { unsafe {
@ -264,8 +264,7 @@ impl<'a> Src64<'a> {
// Safety: bytes_ptr came from an allocation of `capacity` bytes, it's had // Safety: bytes_ptr came from an allocation of `capacity` bytes, it's had
// newlines filled at the end, and `file_size` bytes written over the rest. // newlines filled at the end, and `file_size` bytes written over the rest.
let bytes = let bytes = unsafe { core::slice::from_raw_parts_mut(buf.as_ptr(), capacity) };
unsafe { core::slice::from_raw_parts_mut(buf.as_ptr() as *mut u8, capacity) };
Ok(Self { bytes }) Ok(Self { bytes })
} }