[fractal/avoid-unnecessary-cloning] Avoid unnecessary clone!()




commit 6b240ecb4d91434fcc665ac8da8e4eb6b0d3259e
Author: Alejandro Domínguez <adomu net-c com>
Date:   Wed Aug 25 16:49:18 2021 +0200

    Avoid unnecessary clone!()

 src/components/avatar.rs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/components/avatar.rs b/src/components/avatar.rs
index 49e3e90b..e3cbc25b 100644
--- a/src/components/avatar.rs
+++ b/src/components/avatar.rs
@@ -1,5 +1,5 @@
 use adw::subclass::prelude::*;
-use gtk::{glib, glib::clone, prelude::*, subclass::prelude::*, CompositeTemplate};
+use gtk::{glib, prelude::*, subclass::prelude::*, CompositeTemplate};
 
 use crate::session::Avatar as AvatarItem;
 
@@ -83,9 +83,9 @@ mod imp {
 
         fn constructed(&self, obj: &Self::Type) {
             self.parent_constructed(obj);
-            obj.connect_map(clone!(@weak obj => move |_| {
-                obj.request_custom_avatar();
-            }));
+            obj.connect_map(|avatar| {
+                avatar.request_custom_avatar();
+            });
         }
     }
 


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