Box::deref makes the EDN rendering examples really work!

This commit is contained in:
🪞👃🪞 2025-01-05 16:37:06 +01:00
parent ea8ba031c3
commit 62a0e8c17c
9 changed files with 103 additions and 92 deletions

View file

@ -14,7 +14,11 @@ pub struct Example;
impl EdnLayout<Tui> for &Example {
fn get_content <'a> (&'a self, sym: &'a str) -> RenderBox<'a, Tui> {
Box::new(Thunk::new(move||if sym == ":hello" { "Hello world!" } else { "" }))
Box::new(Thunk::new(move||match sym {
":hello" => "Hello",
":world" => "world",
_ => ""
}))
}
}