[fractal/split-async-state-ui-appop-mgmt: 6/13] Avoid cloning in appop::invite methods




commit 2253e8d8cd872c681026d1623f20f45bc8511224
Author: Alejandro Domínguez <adomu net-c com>
Date:   Thu Dec 3 17:47:21 2020 +0100

    Avoid cloning in appop::invite methods

 fractal-gtk/src/appop/room_settings.rs | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/fractal-gtk/src/appop/room_settings.rs b/fractal-gtk/src/appop/room_settings.rs
index 2f0f476c..6532a8ac 100644
--- a/fractal-gtk/src/appop/room_settings.rs
+++ b/fractal-gtk/src/appop/room_settings.rs
@@ -45,26 +45,25 @@ impl AppOp {
     }
 
     pub fn show_new_room_avatar(&self) -> Option<()> {
-        let panel = self.ui.room_settings.clone()?;
-        panel.show_new_room_avatar();
+        self.ui.room_settings.as_ref()?.show_new_room_avatar();
         None
     }
 
     pub fn show_new_room_name(&self) -> Option<()> {
-        let panel = self.ui.room_settings.clone()?;
-        panel.show_new_room_name();
+        self.ui.room_settings.as_ref()?.show_new_room_name();
         None
     }
 
     pub fn show_new_room_topic(&self) -> Option<()> {
-        let panel = self.ui.room_settings.clone()?;
-        panel.show_new_room_topic();
+        self.ui.room_settings.as_ref()?.show_new_room_topic();
         None
     }
 
     pub fn set_notifications_switch(&self, active: bool, sensitive: bool) -> Option<()> {
-        let panel = self.ui.room_settings.clone()?;
-        panel.set_notifications_switch(active, sensitive);
+        self.ui
+            .room_settings
+            .as_ref()?
+            .set_notifications_switch(active, sensitive);
         None
     }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]