Skip to content

Commit

Permalink
fix: remove mut self from set_native_icon signature (#7866)
Browse files Browse the repository at this point in the history
* fix set_native_icon compile error

* Update core/tauri/src/menu/icon.rs

* Update core/tauri/src/menu/icon.rs

* Create set_native_icon_signature.md

* Update .changes/set_native_icon_signature.md
  • Loading branch information
logankeenan authored Sep 20, 2023
1 parent d6fd121 commit a2021c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/set_native_icon_signature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri": 'patch:bug'
---

Changed `IconMenuItem::set_native_icon` signature to take `&self` instead of `&mut self` to fix compilation error on macos.
2 changes: 1 addition & 1 deletion core/tauri/src/menu/icon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ impl<R: Runtime> IconMenuItem<R> {
/// ## Platform-specific:
///
/// - **Windows / Linux**: Unsupported.
pub fn set_native_icon(&mut self, _icon: Option<NativeIcon>) -> crate::Result<()> {
pub fn set_native_icon(&self, _icon: Option<NativeIcon>) -> crate::Result<()> {
#[cfg(target_os = "macos")]
return run_main_thread!(self, |self_: Self| self_
.inner
Expand Down

0 comments on commit a2021c3

Please sign in to comment.