From d82f8ad014fcffc62dbd16c9414e3f0df82380a6 Mon Sep 17 00:00:00 2001 From: Donghyun Kim Date: Sat, 8 Jun 2024 16:05:27 +0900 Subject: [PATCH] Remove unneeded cast --- rust_crate/src/macros.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/rust_crate/src/macros.rs b/rust_crate/src/macros.rs index 54913f2f..dc2060d8 100644 --- a/rust_crate/src/macros.rs +++ b/rust_crate/src/macros.rs @@ -29,12 +29,10 @@ macro_rules! write_interface { binary_size: usize, ) { let _ = std::panic::catch_unwind(|| { - let message_bytes = unsafe { - std::slice::from_raw_parts(message_pointer as *mut u8, message_size).to_vec() - }; - let binary = unsafe { - std::slice::from_raw_parts(binary_pointer as *mut u8, binary_size).to_vec() - }; + let message_bytes = + unsafe { std::slice::from_raw_parts(message_pointer, message_size).to_vec() }; + let binary = + unsafe { std::slice::from_raw_parts(binary_pointer, binary_size).to_vec() }; messages::generated::handle_dart_signal(message_id as i32, message_bytes, binary); }); }