Skip to content

Commit c9a5f58

Browse files
committed
Remove unnecessary casts of function pointers through usize
1 parent 22c3351 commit c9a5f58

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/codegen/function_body_chunk.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -544,10 +544,7 @@ impl Builder {
544544
if is_destroy || trampoline.scope.is_async() {
545545
format!("Box_::from_raw({func} as *mut _)")
546546
} else if trampoline.scope.is_call() {
547-
format!(
548-
"{} as *const _ as usize as *mut {}",
549-
func, trampoline.bound_name
550-
)
547+
format!("{} as *mut {}", func, trampoline.bound_name)
551548
} else {
552549
format!("&*({func} as *mut _)")
553550
},
@@ -1016,7 +1013,7 @@ impl Builder {
10161013
Chunk::FfiCallParameter {
10171014
transformation_type: TransformationType::ToGlibDirect {
10181015
name: if all_call {
1019-
format!("super_callback{pos} as *const _ as usize as *mut _")
1016+
format!("super_callback{pos} as *const _ as *mut _")
10201017
} else {
10211018
format!("Box_::into_raw(super_callback{pos}) as *mut _")
10221019
},

0 commit comments

Comments
 (0)