mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
Box::deref makes the EDN rendering examples really work!
This commit is contained in:
parent
ea8ba031c3
commit
62a0e8c17c
9 changed files with 103 additions and 92 deletions
|
|
@ -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",
|
||||
_ => ""
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue