diff --git a/packages/ui-mobile-base/nativescript_common/src/android/fs/a_sync.rs b/packages/ui-mobile-base/nativescript_common/src/android/fs/a_sync.rs index 5b20eb2b8..e974cd040 100644 --- a/packages/ui-mobile-base/nativescript_common/src/android/fs/a_sync.rs +++ b/packages/ui-mobile-base/nativescript_common/src/android/fs/a_sync.rs @@ -25,10 +25,6 @@ pub(crate) struct AsyncCallbackInner { } impl AsyncCallbackInner { - pub(crate) fn inner_raw(&self) -> *mut jni::objects::GlobalRef { - self.inner as *mut jni::objects::GlobalRef - } - pub(crate) fn inner(&self) -> jni::objects::GlobalRef { unsafe { (&*(self.inner as *mut jni::objects::GlobalRef)).clone() } } diff --git a/packages/ui-mobile-base/nativescript_common/src/android/fs/async_callback.rs b/packages/ui-mobile-base/nativescript_common/src/android/fs/async_callback.rs index 7703f5561..80f93626b 100644 --- a/packages/ui-mobile-base/nativescript_common/src/android/fs/async_callback.rs +++ b/packages/ui-mobile-base/nativescript_common/src/android/fs/async_callback.rs @@ -22,6 +22,6 @@ pub extern "system" fn Java_org_nativescript_widgets_filesystem_AsyncCallback_di _: JClass, callback: jlong, ) { - let callback = unsafe { callback as *const AsyncCallback }; + let callback = callback as *const AsyncCallback; let _ = unsafe { Arc::from_raw(callback) }; } diff --git a/packages/ui-mobile-base/nativescript_common/src/android/fs/file_dir.rs b/packages/ui-mobile-base/nativescript_common/src/android/fs/file_dir.rs index e686f14f6..e3ee75754 100644 --- a/packages/ui-mobile-base/nativescript_common/src/android/fs/file_dir.rs +++ b/packages/ui-mobile-base/nativescript_common/src/android/fs/file_dir.rs @@ -40,7 +40,7 @@ pub extern "system" fn Java_org_nativescript_widgets_filesystem_FileDir_nativeCl file_dir: jlong, callback: jlong, ) { - let callback = unsafe { callback as *const AsyncCallback }; + let callback = callback as *const AsyncCallback; let on_success = AsyncCallback::clone_from_ptr(callback); let dir: *mut FileDir = file_dir as _; if !dir.is_null() { @@ -111,7 +111,7 @@ pub extern "system" fn Java_org_nativescript_widgets_filesystem_FileDir_nativeRe file_dir: jlong, callback: jlong, ) { - let callback = unsafe { callback as *const AsyncCallback }; + let callback = callback as *const AsyncCallback; let on_success = AsyncCallback::clone_from_ptr(callback); let dir: *mut FileDir = file_dir as _; if !dir.is_null() { diff --git a/packages/ui-mobile-base/nativescript_common/src/android/fs/fs_watch.rs b/packages/ui-mobile-base/nativescript_common/src/android/fs/fs_watch.rs index a914ae3db..9c9af35d2 100644 --- a/packages/ui-mobile-base/nativescript_common/src/android/fs/fs_watch.rs +++ b/packages/ui-mobile-base/nativescript_common/src/android/fs/fs_watch.rs @@ -1,5 +1,5 @@ use std::collections::HashMap; -use std::ffi::{CStr}; +use std::ffi::CStr; use std::os::raw::c_char; use std::ptr::NonNull; use std::sync::Arc; @@ -18,6 +18,7 @@ use crate::common::fs::a_sync::{AsyncClosure, WatchEvent}; type WatcherCallbackMap = Arc, FsWatchCallback>>>; +#[allow(dead_code)] pub struct FsWatchCallback { callback: Arc, inner: Arc>, @@ -194,7 +195,7 @@ pub extern "system" fn Java_org_nativescript_widgets_filesystem_WatcherEvent_nat on_close: jlong, ) { let callback = callback as *const AsyncCallback; - let on_close = unsafe { on_close as *const AsyncCallback }; + let on_close = on_close as *const AsyncCallback; let callback = AsyncCallback::clone_from_ptr(callback); let on_close = AsyncCallback::clone_from_ptr(on_close);