From 8a6766173b3da4446a87642e7282c73a5b631afe Mon Sep 17 00:00:00 2001 From: yydcnjjw Date: Wed, 16 Aug 2023 10:21:23 +0800 Subject: [PATCH] feat(tauri): impl Send for app::Builder, closes #7618 (#7619) * feat(tauri): impl Send for app::Builder * chore: add .changes/app-builder-send.md --- .changes/app-builder-send.md | 5 +++++ core/tauri/src/app.rs | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changes/app-builder-send.md diff --git a/.changes/app-builder-send.md b/.changes/app-builder-send.md new file mode 100644 index 000000000000..479dbad7d5ab --- /dev/null +++ b/.changes/app-builder-send.md @@ -0,0 +1,5 @@ +--- +"tauri": patch:enhance +--- + +Ensure Builder is Send by requiring the menu closure to be Send. diff --git a/core/tauri/src/app.rs b/core/tauri/src/app.rs index 2cd80bdeee44..036ba89cfa54 100644 --- a/core/tauri/src/app.rs +++ b/core/tauri/src/app.rs @@ -997,7 +997,7 @@ pub struct Builder { /// A closure that returns the menu set to all windows. #[cfg(desktop)] - menu: Option) -> crate::Result>>>, + menu: Option) -> crate::Result> + Send>>, /// Enable macOS default menu creation. #[allow(unused)] @@ -1295,7 +1295,7 @@ impl Builder { /// ``` #[must_use] #[cfg(desktop)] - pub fn menu) -> crate::Result> + 'static>( + pub fn menu) -> crate::Result> + Send + 'static>( mut self, f: F, ) -> Self {