Skip to content

Commit 051aefb

Browse files
ndmitchellfacebook-github-bot
authored andcommitted
Remove some redundant casts
Summary: These went from the same input to output type, so totally useless. Spotted by a new version of clippy. Reviewed By: JakobDegen Differential Revision: D47226538 fbshipit-source-id: 083079305f1411bf9905aa7eec5aef824329093e
1 parent fe3a2e5 commit 051aefb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

starlark/src/collections/alloca.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct Buffer {
3838

3939
impl Buffer {
4040
fn alloc(layout: Layout) -> Buffer {
41-
let ptr = unsafe { alloc(layout) as *mut u8 };
41+
let ptr = unsafe { alloc(layout) };
4242
let ptr = NonNull::new(ptr).unwrap();
4343
Buffer { ptr, layout }
4444
}

starlark/src/values/layout/heap/arena.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl<A: ArenaAllocator> Arena<A> {
184184
unsafe {
185185
let repr = &mut *(p as *mut MaybeUninit<AValueRepr<T>>);
186186
let extra = slice::from_raw_parts_mut(
187-
(p as *mut u8).add(AValueRepr::<T>::offset_of_extra()) as *mut _,
187+
p.add(AValueRepr::<T>::offset_of_extra()) as *mut _,
188188
extra_len,
189189
);
190190
(repr, extra)

0 commit comments

Comments
 (0)