Pārlūkot izejas kodu

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
Logan Keenan 1 gadu atpakaļ
vecāks
revīzija
a2021c30ba

+ 5 - 0
.changes/set_native_icon_signature.md

@@ -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.

+ 1 - 1
core/tauri/src/menu/icon.rs

@@ -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