Skip to content

Commit a2021c3

Browse files
authored
fix: remove mut self from set_native_icon signature (#7866)
* 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
1 parent d6fd121 commit a2021c3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": 'patch:bug'
3+
---
4+
5+
Changed `IconMenuItem::set_native_icon` signature to take `&self` instead of `&mut self` to fix compilation error on macos.

core/tauri/src/menu/icon.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ impl<R: Runtime> IconMenuItem<R> {
205205
/// ## Platform-specific:
206206
///
207207
/// - **Windows / Linux**: Unsupported.
208-
pub fn set_native_icon(&mut self, _icon: Option<NativeIcon>) -> crate::Result<()> {
208+
pub fn set_native_icon(&self, _icon: Option<NativeIcon>) -> crate::Result<()> {
209209
#[cfg(target_os = "macos")]
210210
return run_main_thread!(self, |self_: Self| self_
211211
.inner

0 commit comments

Comments
 (0)