mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +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
|
// 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 })
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue