Use option<&str> instead of owned option string

This commit is contained in:
Jackson Coxson
2025-08-08 10:18:31 -06:00
parent 21584f4190
commit d59f028251
10 changed files with 76 additions and 164 deletions

View File

@@ -514,7 +514,7 @@ pub unsafe extern "C" fn image_mounter_query_nonce(
let image_type = if !personalized_image_type.is_null() {
let image_type_cstr = unsafe { std::ffi::CStr::from_ptr(personalized_image_type) };
match image_type_cstr.to_str() {
Ok(s) => Some(s.to_string()),
Ok(s) => Some(s),
Err(_) => return ffi_err!(IdeviceError::FfiInvalidArg),
}
} else {
@@ -566,7 +566,7 @@ pub unsafe extern "C" fn image_mounter_query_personalization_identifiers(
let image_type = if !image_type.is_null() {
let image_type_cstr = unsafe { std::ffi::CStr::from_ptr(image_type) };
match image_type_cstr.to_str() {
Ok(s) => Some(s.to_string()),
Ok(s) => Some(s),
Err(_) => return ffi_err!(IdeviceError::FfiInvalidArg),
}
} else {