diff --git a/examples/hello_world.rs b/examples/hello_world.rs index 87849a2..1e45d48 100644 --- a/examples/hello_world.rs +++ b/examples/hello_world.rs @@ -5,7 +5,7 @@ use osui::prelude::*; fn main() { let mut cx = Context::new(app); cx.refresh(); - // println!("{:?}", cx.get_nodes()); + println!("{:?}", cx.get_nodes()); } fn app(cx: &mut Context) -> Vec { diff --git a/src/lib.rs b/src/lib.rs index d283559..0384e0f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,3 +14,16 @@ pub enum Node { String(Arc String>), Component(component::Component), } + +impl std::fmt::Debug for Node { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!( + f, + "{}", + match self { + Self::Component(_) => format!("Component"), + Self::String(v) => format!("String({})", v()), + } + ) + } +}