From 913798243d946e0cfa67cb6254ad53628ff3d02e Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Mon, 14 Sep 2020 21:35:48 +0200 Subject: [PATCH] Tree: NodeData impl Clone if possible --- src/tree.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/tree.rs b/src/tree.rs index 873a256..da5295e 100644 --- a/src/tree.rs +++ b/src/tree.rs @@ -85,6 +85,23 @@ impl Default for NodeData { } } +impl Clone for NodeData { + fn clone(&self) -> Self { + Self { + disabled: self.disabled, + has_caret: self.has_caret, + icon: self.icon, + icon_color: self.icon_color.clone(), + icon_intent: self.icon_intent, + is_expanded: self.is_expanded, + is_selected: self.is_selected, + label: self.label.clone(), + secondary_label: self.secondary_label.clone(), + data: self.data.clone(), + } + } +} + impl Component for Tree { type Message = (); type Properties = Props;