mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
use Arc<str> where applicable; use konst split_at
This commit is contained in:
parent
411fc0c4bc
commit
305481adee
35 changed files with 286 additions and 273 deletions
|
|
@ -18,6 +18,15 @@ impl Content<TuiOut> for String {
|
|||
}
|
||||
}
|
||||
|
||||
impl Content<TuiOut> for Arc<str> {
|
||||
fn layout (&self, to: [u16;4]) -> [u16;4] {
|
||||
to.center_xy([self.chars().count() as u16, 1])
|
||||
}
|
||||
fn render (&self, to: &mut TuiOut) {
|
||||
to.blit(self, to.area.x(), to.area.y(), None)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Repeat<'a>(pub &'a str);
|
||||
|
||||
impl Content<TuiOut> for Repeat<'_> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue