wip: doctest layouts

This commit is contained in:
facile pop culture reference 2026-07-30 17:44:40 +03:00
parent 5ca329292f
commit cd5b0cc113
3 changed files with 57 additions and 36 deletions

View file

@ -44,6 +44,14 @@ impl Interpret<Tui, Color> for State {
}
}
}
fn try_to_u8 (src: Perhaps<&str>) -> Perhaps<u8> {
use std::str::FromStr;
if let Some(src) = src? {
Ok(Some(u8::from_str(src)?))
} else {
Ok(None)
}
}
impl Interpret<Tui, Option<XYWH<u16>>> for State {
fn interpret_word (&self, to: &mut Tui, sym: &impl Language) -> Perhaps<XYWH<u16>> {
match sym.src()? {