Skip to content

Commit efeda31

Browse files
committed
Use inner muda id
1 parent 9eea0a9 commit efeda31

7 files changed

Lines changed: 7 additions & 9 deletions

File tree

crates/tauri/src/menu/check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl<R: Runtime> CheckMenuItem<R> {
8282

8383
/// Returns a unique identifier associated with this menu item.
8484
pub fn id(&self) -> &MenuId {
85-
&self.0.id
85+
self.0.inner.id()
8686
}
8787

8888
/// Get the text for this menu item.

crates/tauri/src/menu/icon.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ impl<R: Runtime> IconMenuItem<R> {
161161

162162
/// Returns a unique identifier associated with this menu item.
163163
pub fn id(&self) -> &MenuId {
164-
&self.0.id
164+
self.0.inner.id()
165165
}
166166

167167
/// Get the text for this menu item.

crates/tauri/src/menu/menu.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ impl<R: Runtime> Menu<R> {
251251

252252
/// Returns a unique identifier associated with this menu.
253253
pub fn id(&self) -> &MenuId {
254-
&self.0.id
254+
self.0.inner.id()
255255
}
256256

257257
/// Add a menu item to the end of this menu.

crates/tauri/src/menu/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ macro_rules! gen_wrappers {
7070
$(
7171
#[tauri_macros::default_runtime(crate::Wry, wry)]
7272
pub(crate) struct $inner<R: $crate::Runtime> {
73-
id: $crate::menu::MenuId,
7473
// SAFETY: we only call `ManuallyDrop::take` in [`Self::drop`] to drop it on main thread
7574
inner: ManuallyDrop<::muda::$type>,
7675
app_handle: $crate::AppHandle<R>,
@@ -79,7 +78,6 @@ macro_rules! gen_wrappers {
7978
impl<R: $crate::Runtime> $inner<R> {
8079
fn new(app_handle: $crate::AppHandle<R>, menu: ::muda::$type) -> Self {
8180
Self {
82-
id: menu.id().clone(),
8381
inner: ManuallyDrop::new(menu),
8482
app_handle,
8583
}
@@ -133,7 +131,7 @@ macro_rules! gen_wrappers {
133131
}
134132

135133
fn id(&self) -> &MenuId {
136-
&self.0.id
134+
self.0.inner.id()
137135
}
138136
}
139137
)*

crates/tauri/src/menu/normal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl<R: Runtime> MenuItem<R> {
8080

8181
/// Returns a unique identifier associated with this menu item.
8282
pub fn id(&self) -> &MenuId {
83-
&self.0.id
83+
self.0.inner.id()
8484
}
8585

8686
/// Get the text for this menu item.

crates/tauri/src/menu/predefined.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ impl<R: Runtime> PredefinedMenuItem<R> {
337337

338338
/// Returns a unique identifier associated with this menu item.
339339
pub fn id(&self) -> &MenuId {
340-
&self.0.id
340+
self.0.inner.id()
341341
}
342342

343343
/// Get the text for this menu item.

crates/tauri/src/menu/submenu.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ impl<R: Runtime> Submenu<R> {
246246

247247
/// Returns a unique identifier associated with this submenu.
248248
pub fn id(&self) -> &MenuId {
249-
&self.0.id
249+
self.0.inner.id()
250250
}
251251

252252
/// Add a menu item to the end of this submenu.

0 commit comments

Comments
 (0)