Skip to content

Commit

Permalink
fix: changed IconMenuItem::set_native_icon to take &self
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Aug 19, 2023
1 parent a9f16c8 commit e046132
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changes/native_icon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"muda": "patch"
---

Changed `IconMenuItem::set_native_icon` to take `&self` instead of `&mut self`.
2 changes: 1 addition & 1 deletion src/items/icon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ impl IconMenuItem {
/// ## Platform-specific:
///
/// - **Windows / Linux**: Unsupported.
pub fn set_native_icon(&mut self, _icon: Option<NativeIcon>) {
pub fn set_native_icon(&self, _icon: Option<NativeIcon>) {
#[cfg(target_os = "macos")]
self.inner.borrow_mut().set_native_icon(_icon)
}
Expand Down
2 changes: 1 addition & 1 deletion src/items/submenu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<MenuItemKind> {
let mut items = self.items();
if items.len() > position {
Expand Down
2 changes: 1 addition & 1 deletion src/menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<MenuItemKind> {
let mut items = self.items();
if items.len() > position {
Expand Down

0 comments on commit e046132

Please sign in to comment.