Skip to content

Commit 8a67661

Browse files
authored
feat(tauri): impl Send for app::Builder, closes #7618 (#7619)
* feat(tauri): impl Send for app::Builder * chore: add .changes/app-builder-send.md
1 parent 04949d1 commit 8a67661

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changes/app-builder-send.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch:enhance
3+
---
4+
5+
Ensure Builder is Send by requiring the menu closure to be Send.

core/tauri/src/app.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ pub struct Builder<R: Runtime> {
997997

998998
/// A closure that returns the menu set to all windows.
999999
#[cfg(desktop)]
1000-
menu: Option<Box<dyn FnOnce(&AppHandle<R>) -> crate::Result<Menu<R>>>>,
1000+
menu: Option<Box<dyn FnOnce(&AppHandle<R>) -> crate::Result<Menu<R>> + Send>>,
10011001

10021002
/// Enable macOS default menu creation.
10031003
#[allow(unused)]
@@ -1295,7 +1295,7 @@ impl<R: Runtime> Builder<R> {
12951295
/// ```
12961296
#[must_use]
12971297
#[cfg(desktop)]
1298-
pub fn menu<F: FnOnce(&AppHandle<R>) -> crate::Result<Menu<R>> + 'static>(
1298+
pub fn menu<F: FnOnce(&AppHandle<R>) -> crate::Result<Menu<R>> + Send + 'static>(
12991299
mut self,
13001300
f: F,
13011301
) -> Self {

0 commit comments

Comments
 (0)