Remove `Clone` bound from `IconElement`

Marshall Bowers created

Change summary

crates/ui2/src/components/tab.rs | 6 +++---
crates/ui2/src/elements/icon.rs  | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)

Detailed changes

crates/ui2/src/components/tab.rs 🔗

@@ -94,7 +94,7 @@ impl<S: 'static + Send + Sync + Clone> Tab<S> {
             (GitStatus::Conflict, false) => Label::new(self.title.clone()),
         };
 
-        let close_icon = IconElement::new(Icon::Close).color(IconColor::Muted);
+        let close_icon = || IconElement::new(Icon::Close).color(IconColor::Muted);
 
         let (tab_bg, tab_hover_bg, tab_active_bg) = match self.current {
             true => (
@@ -131,13 +131,13 @@ impl<S: 'static + Send + Sync + Clone> Tab<S> {
                     }))
                     .children(self.icon.map(IconElement::new))
                     .children(if self.close_side == IconSide::Left {
-                        Some(close_icon.clone())
+                        Some(close_icon())
                     } else {
                         None
                     })
                     .child(label)
                     .children(if self.close_side == IconSide::Right {
-                        Some(close_icon)
+                        Some(close_icon())
                     } else {
                         None
                     }),

crates/ui2/src/elements/icon.rs 🔗

@@ -148,7 +148,7 @@ impl Icon {
     }
 }
 
-#[derive(Element, Clone)]
+#[derive(Element)]
 pub struct IconElement<S: 'static + Send + Sync> {
     state_type: PhantomData<S>,
     icon: Icon,