From e046132dfba47ab75905ff28c354f83b5b27703d Mon Sep 17 00:00:00 2001 From: Amr Bashir Date: Sat, 19 Aug 2023 17:27:39 +0300 Subject: [PATCH] fix: changed `IconMenuItem::set_native_icon` to take `&self` --- .changes/native_icon.md | 5 +++++ src/items/icon.rs | 2 +- src/items/submenu.rs | 2 +- src/menu.rs | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changes/native_icon.md diff --git a/.changes/native_icon.md b/.changes/native_icon.md new file mode 100644 index 0000000..c000e74 --- /dev/null +++ b/.changes/native_icon.md @@ -0,0 +1,5 @@ +--- +"muda": "patch" +--- + +Changed `IconMenuItem::set_native_icon` to take `&self` instead of `&mut self`. diff --git a/src/items/icon.rs b/src/items/icon.rs index 222b658..1e3a44b 100644 --- a/src/items/icon.rs +++ b/src/items/icon.rs @@ -176,7 +176,7 @@ impl IconMenuItem { /// ## Platform-specific: /// /// - **Windows / Linux**: Unsupported. - pub fn set_native_icon(&mut self, _icon: Option) { + pub fn set_native_icon(&self, _icon: Option) { #[cfg(target_os = "macos")] self.inner.borrow_mut().set_native_icon(_icon) } diff --git a/src/items/submenu.rs b/src/items/submenu.rs index eb997fa..9005671 100644 --- a/src/items/submenu.rs +++ b/src/items/submenu.rs @@ -132,7 +132,7 @@ impl Submenu { self.inner.borrow_mut().remove(item) } - /// Remove the menu item at the specified position from this submenu. + /// Remove the menu item at the specified position from this submenu and returns it. pub fn remove_at(&self, position: usize) -> Option { let mut items = self.items(); if items.len() > position { diff --git a/src/menu.rs b/src/menu.rs index bf84e1b..9458ab5 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -144,7 +144,7 @@ impl Menu { self.inner.borrow_mut().remove(item) } - /// Remove the menu item at the specified position from this menu. + /// Remove the menu item at the specified position from this menu and returns it. pub fn remove_at(&self, position: usize) -> Option { let mut items = self.items(); if items.len() > position {