web engine - experimental web browser

Simplify CStr construction in no-arg msg_send! variant

Use the same clean pattern as the other msg_send! variants instead of
the roundabout split_last + from_raw_parts approach.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+4 -4
+4 -4
crates/platform/src/objc.rs
··· 300 300 macro_rules! msg_send { 301 301 // No arguments: msg_send![receiver, selector] 302 302 [$receiver:expr, $sel:ident] => {{ 303 - let sel = $crate::objc::Sel::register(concat!(stringify!($sel), "\0").as_bytes() 304 - .split_last().map(|(_, s)| unsafe { std::ffi::CStr::from_bytes_with_nul_unchecked( 305 - std::slice::from_raw_parts(s.as_ptr(), s.len() + 1) 306 - ) }).unwrap()); 303 + let sel_name = concat!(stringify!($sel), "\0"); 304 + let sel = $crate::objc::Sel::register(unsafe { 305 + std::ffi::CStr::from_bytes_with_nul_unchecked(sel_name.as_bytes()) 306 + }); 307 307 let func: unsafe extern "C" fn(*mut std::os::raw::c_void, *mut std::os::raw::c_void) -> _ 308 308 = unsafe { std::mem::transmute($crate::objc::msg_send_fn()) }; 309 309 unsafe { func($receiver as *mut std::os::raw::c_void, sel.as_ptr() as *mut std::os::raw::c_void) }