feat(tauri): impl Send for app::Builder, closes #7618 (#7619)

* feat(tauri): impl Send for app::Builder

* chore: add .changes/app-builder-send.md
This commit is contained in:
yydcnjjw 2023-08-16 10:21:23 +08:00 committed by GitHub
parent 04949d1658
commit 8a6766173b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -0,0 +1,5 @@
---
"tauri": patch:enhance
---
Ensure Builder is Send by requiring the menu closure to be Send.

View File

@ -997,7 +997,7 @@ pub struct Builder<R: Runtime> {
/// A closure that returns the menu set to all windows. /// A closure that returns the menu set to all windows.
#[cfg(desktop)] #[cfg(desktop)]
menu: Option<Box<dyn FnOnce(&AppHandle<R>) -> crate::Result<Menu<R>>>>, menu: Option<Box<dyn FnOnce(&AppHandle<R>) -> crate::Result<Menu<R>> + Send>>,
/// Enable macOS default menu creation. /// Enable macOS default menu creation.
#[allow(unused)] #[allow(unused)]
@ -1295,7 +1295,7 @@ impl<R: Runtime> Builder<R> {
/// ``` /// ```
#[must_use] #[must_use]
#[cfg(desktop)] #[cfg(desktop)]
pub fn menu<F: FnOnce(&AppHandle<R>) -> crate::Result<Menu<R>> + 'static>( pub fn menu<F: FnOnce(&AppHandle<R>) -> crate::Result<Menu<R>> + Send + 'static>(
mut self, mut self,
f: F, f: F,
) -> Self { ) -> Self {