Skip to content

Commit

Permalink
[rust] fixes clippy warnings of missing_transmute_annotations (#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
hkrn authored Jul 18, 2024
1 parent db760c2 commit faa0f70
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion rust/plugin_wasm/src/model/c_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ pub unsafe extern "C" fn nanoemApplicationPluginModelIOCreateWithLocation(
let result = instance.create();
if result.is_ok() {
let plugin = Box::new(instance);
return unsafe { std::mem::transmute(plugin) };
return unsafe {
std::mem::transmute::<
Box<nanoem_application_plugin_model_io_t>,
*mut nanoem_application_plugin_model_io_t,
>(plugin)
};
}
}
null_mut()
Expand Down
7 changes: 6 additions & 1 deletion rust/plugin_wasm/src/motion/c_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ pub unsafe extern "C" fn nanoemApplicationPluginMotionIOCreateWithLocation(
let result = instance.create();
if result.is_ok() {
let plugin = Box::new(instance);
return unsafe { std::mem::transmute(plugin) };
return unsafe {
std::mem::transmute::<
Box<nanoem_application_plugin_motion_io_t>,
*mut nanoem_application_plugin_motion_io_t,
>(plugin)
};
}
}
null_mut()
Expand Down

0 comments on commit faa0f70

Please sign in to comment.