diff options
| author | Sebastian Holmin <sebastain@holmin@mullvad.com> | 2025-07-07 15:52:15 +0200 |
|---|---|---|
| committer | Sebastian Holmin <sebastian.holmin@mullvad.net> | 2025-07-09 16:28:05 +0200 |
| commit | a761a974cbfbfb2e2203faff227f43567112e7c4 (patch) | |
| tree | 7b5c0f975d840b951fdde450ec6e34f32bacd3ed /mullvad-ios/src/api_client/api.rs | |
| parent | 8d96b12c8442d180669993d425dbe9a56500bf1f (diff) | |
| download | mullvadvpn-a761a974cbfbfb2e2203faff227f43567112e7c4.tar.xz mullvadvpn-a761a974cbfbfb2e2203faff227f43567112e7c4.zip | |
Add unsafe block in unsafe fn
Also make extern blocks unsafe
Diffstat (limited to 'mullvad-ios/src/api_client/api.rs')
| -rw-r--r-- | mullvad-ios/src/api_client/api.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/mullvad-ios/src/api_client/api.rs b/mullvad-ios/src/api_client/api.rs index bc2fdd324f..20fe2ba248 100644 --- a/mullvad-ios/src/api_client/api.rs +++ b/mullvad-ios/src/api_client/api.rs @@ -36,7 +36,8 @@ pub unsafe extern "C" fn mullvad_ios_get_addresses( completion_cookie: *mut libc::c_void, retry_strategy: SwiftRetryStrategy, ) -> SwiftCancelHandle { - let completion_handler = SwiftCompletionHandler::new(CompletionCookie::new(completion_cookie)); + let completion_handler = + SwiftCompletionHandler::new(unsafe { CompletionCookie::new(completion_cookie) }); let Ok(tokio_handle) = crate::mullvad_ios_runtime() else { completion_handler.finish(SwiftMullvadApiResponse::no_tokio_runtime()); @@ -81,7 +82,8 @@ pub unsafe extern "C" fn mullvad_ios_api_addrs_available( retry_strategy: SwiftRetryStrategy, access_method_setting: *const c_void, ) -> SwiftCancelHandle { - let completion_handler = SwiftCompletionHandler::new(CompletionCookie::new(completion_cookie)); + let completion_handler = + SwiftCompletionHandler::new(unsafe { CompletionCookie::new(completion_cookie) }); let Ok(tokio_handle) = crate::mullvad_ios_runtime() else { completion_handler.finish(SwiftMullvadApiResponse::no_tokio_runtime()); @@ -155,7 +157,8 @@ pub unsafe extern "C" fn mullvad_ios_get_relays( retry_strategy: SwiftRetryStrategy, etag: *const c_char, ) -> SwiftCancelHandle { - let completion_handler = SwiftCompletionHandler::new(CompletionCookie::new(completion_cookie)); + let completion_handler = + SwiftCompletionHandler::new(unsafe { CompletionCookie::new(completion_cookie) }); let Ok(tokio_handle) = crate::mullvad_ios_runtime() else { completion_handler.finish(SwiftMullvadApiResponse::no_tokio_runtime()); |
