Skip to content

Commit

Permalink
feat(tauri): impl Send for app::Builder, closes #7618 (#7619)
Browse files Browse the repository at this point in the history
* feat(tauri): impl Send for app::Builder

* chore: add .changes/app-builder-send.md
  • Loading branch information
yydcnjjw committed Aug 16, 2023
1 parent 04949d1 commit 8a67661
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changes/app-builder-send.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri": patch:enhance
---

Ensure Builder is Send by requiring the menu closure to be Send.
4 changes: 2 additions & 2 deletions core/tauri/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ pub struct Builder<R: Runtime> {

/// A closure that returns the menu set to all windows.
#[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.
#[allow(unused)]
Expand Down Expand Up @@ -1295,7 +1295,7 @@ impl<R: Runtime> Builder<R> {
/// ```
#[must_use]
#[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,
f: F,
) -> Self {
Expand Down

0 comments on commit 8a67661

Please sign in to comment.