add lifetime to Draw trait
Some checks failed
/ build (push) Has been cancelled

This commit is contained in:
facile pop culture reference 2026-08-18 10:46:20 +03:00
parent 20517f09b4
commit a9f2fa2cdd
17 changed files with 655 additions and 491 deletions

View file

@ -45,16 +45,20 @@ impl_keywords!(Tui, XYWH<u16>, State [
kw_tui_bg
]);
impl Interpret<Tui, Option<XYWH<u16>>> for State {
fn interpret_word (&self, to: &mut Tui, sym: &impl Language) -> Perhaps<XYWH<u16>> {
match sym.src()? {
impl<'a> Interpret<'a, Tui, Option<XYWH<u16>>> for State {
fn interpret_word <L: Language<'a> + ?Sized> (&'a self, to: &mut Tui, lang: &'a L)
-> Drawn<'a, u16>
{
match lang.src()? {
Some(":foo") => "foo".draw(to),
Some(":bar") => "bar".draw(to),
Some(":foobar") => "FOOBAR".draw(to),
src => todo!("src: {src:?}")
}
}
fn interpret_expr (&self, to: &mut Tui, src: &impl Expression) -> Perhaps<XYWH<u16>> {
fn interpret_expr <L: Language<'a> + ?Sized> (&self, to: &mut Tui, src: &'a L)
-> Drawn<'a, u16>
{
if let Some(area) = self.keyword(to, src)? {
Ok(Some(area))
} else {