ソースを参照

fix(core): drop all plugin builder Sync requirements (#3490)

Lucas Fernandes Nogueira 3 年 前
コミット
b8e4d651f9
2 ファイル変更4 行追加4 行削除
  1. 1 1
      .changes/fix-drop-sync.md
  2. 3 3
      core/tauri/src/plugin.rs

+ 1 - 1
.changes/fix-drop-sync.md

@@ -2,4 +2,4 @@
 "tauri": patch
 ---
 
-Callbacks passed to `tauri::plugin::Builder::setup` or `tauri::plugin::Builder::setup_with_config` are no longer required to implement `Sync`.
+`tauri::plugin::Builder` closures are no longer required to implement `Sync`.

+ 3 - 3
core/tauri/src/plugin.rs

@@ -56,9 +56,9 @@ pub trait Plugin<R: Runtime>: Send {
 
 type SetupHook<R> = dyn FnOnce(&AppHandle<R>) -> Result<()> + Send;
 type SetupWithConfigHook<R, T> = dyn FnOnce(&AppHandle<R>, T) -> Result<()> + Send;
-type OnWebviewReady<R> = dyn FnMut(Window<R>) + Send + Sync;
-type OnEvent<R> = dyn FnMut(&AppHandle<R>, &RunEvent) + Send + Sync;
-type OnPageLoad<R> = dyn FnMut(Window<R>, PageLoadPayload) + Send + Sync;
+type OnWebviewReady<R> = dyn FnMut(Window<R>) + Send;
+type OnEvent<R> = dyn FnMut(&AppHandle<R>, &RunEvent) + Send;
+type OnPageLoad<R> = dyn FnMut(Window<R>, PageLoadPayload) + Send;
 
 /// Builds a [`TauriPlugin`].
 ///