diff --git a/src/tree.rs b/src/tree.rs index a85bd86..e116ffc 100644 --- a/src/tree.rs +++ b/src/tree.rs @@ -11,12 +11,23 @@ use std::marker::PhantomData; use std::rc::Rc; use yew::prelude::*; -#[derive(Clone)] +#[derive(Debug)] pub struct TreeData { tree: Rc>>>, version: usize, } +impl Clone for TreeData { + fn clone(&self) -> Self { + Self { + tree: self.tree.clone(), + version: self.version, + } + } +} + +impl yew::html::ImplicitClone for TreeData {} + impl PartialEq for TreeData { fn eq(&self, other: &Self) -> bool { Rc::ptr_eq(&self.tree, &other.tree) && self.version == other.version @@ -63,6 +74,7 @@ pub struct TreeProps { pub class: Classes, } +#[derive(Debug)] pub struct NodeData { pub disabled: bool, pub has_caret: bool,