mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
redundant pointer casts
This commit is contained in:
parent
49c2b1dbb7
commit
4fb3e90451
1 changed files with 2 additions and 3 deletions
|
@ -82,7 +82,7 @@ impl<'a> Src64<'a> {
|
|||
}
|
||||
|
||||
// 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.
|
||||
unsafe {
|
||||
|
@ -264,8 +264,7 @@ impl<'a> Src64<'a> {
|
|||
|
||||
// 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.
|
||||
let bytes =
|
||||
unsafe { core::slice::from_raw_parts_mut(buf.as_ptr() as *mut u8, capacity) };
|
||||
let bytes = unsafe { core::slice::from_raw_parts_mut(buf.as_ptr(), capacity) };
|
||||
|
||||
Ok(Self { bytes })
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue