Testing
This commit is contained in:
@@ -5,7 +5,7 @@ use osui::prelude::*;
|
|||||||
fn main() {
|
fn main() {
|
||||||
let mut cx = Context::new(app);
|
let mut cx = Context::new(app);
|
||||||
cx.refresh();
|
cx.refresh();
|
||||||
// println!("{:?}", cx.get_nodes());
|
println!("{:?}", cx.get_nodes());
|
||||||
}
|
}
|
||||||
|
|
||||||
fn app(cx: &mut Context) -> Vec<Node> {
|
fn app(cx: &mut Context) -> Vec<Node> {
|
||||||
|
|||||||
+13
@@ -14,3 +14,16 @@ pub enum Node {
|
|||||||
String(Arc<dyn Fn() -> String>),
|
String(Arc<dyn Fn() -> String>),
|
||||||
Component(component::Component),
|
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()),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user