Address Mac build failures

This commit is contained in:
Skyler Lehmkuhl 2026-03-09 22:03:51 -04:00
parent 0ae97f9562
commit 8bd65e5904
1 changed files with 2 additions and 5 deletions

View File

@ -63,11 +63,8 @@ mod platform_impl {
for &mime in preferred {
let ns_type = NSString::from_str(mime);
if let Some(ns_data) = pb.dataForType(&ns_type) {
let len = ns_data.length();
// SAFETY: bytes() is valid for length() bytes per NSData contract.
let bytes = unsafe {
std::slice::from_raw_parts(ns_data.bytes() as *const u8, len).to_vec()
};
// NSData: Deref<Target=[u8]> — auto-deref resolves to [u8]::to_vec().
let bytes = ns_data.to_vec();
return Some((mime.to_string(), bytes));
}
}