mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
wip: and sweeps right through the codebase
This commit is contained in:
parent
d37bd3e0c5
commit
c9b09b7dea
16 changed files with 370 additions and 625 deletions
|
|
@ -46,11 +46,11 @@ pub type Perhaps<T> = Result<Option<T>, Box<dyn Error>>;
|
|||
fn area_mut (&mut self) -> &mut [u16;4] {
|
||||
&mut self.0
|
||||
}
|
||||
fn render_in (&mut self, _: [u16;4], _: &impl Render<TestEngine>) -> Usually<()> {
|
||||
Ok(())
|
||||
fn place (&mut self, _: [u16;4], _: &impl Layout<TestEngine>) {
|
||||
()
|
||||
}
|
||||
}
|
||||
impl Render<TestEngine> for String {
|
||||
impl Layout<TestEngine> for String {
|
||||
fn render (&self, to: &mut TestOutput) {
|
||||
to.area_mut().set_w(self.len() as u16);
|
||||
}
|
||||
|
|
@ -63,7 +63,7 @@ pub type Perhaps<T> = Result<Option<T>, Box<dyn Error>>;
|
|||
use std::sync::{Arc, RwLock};
|
||||
struct TestComponent(String);
|
||||
impl Layout<Tui> for TestComponent {
|
||||
fn layout (&self) -> Option<impl Render<Tui>> {
|
||||
fn layout (&self) -> Option<impl Layout<Tui>> {
|
||||
Some(self.0.as_str())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue