Closed kupiakos closed 10 months ago
For use with C interfaces:
#[no_mangle] pub unsafe extern "C" foo(data: *mut u8, size: usize) { // Before (the turbofish is necessary): let buf = Out::from(slice::from_raw_parts_mut(data.cast::<MaybeUninit<u8>>(), size)); // After: let buf = Out::slice_from_raw_parts(data, size); }
For use with C interfaces: