mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
this may actually be a performance regression, i'm only profiling once
This commit is contained in:
parent
680a841e3f
commit
f5d84c2450
2 changed files with 65 additions and 31 deletions
|
|
@ -20,6 +20,24 @@ impl Content<TuiOut> for String {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: Content<TuiOut>> Content<TuiOut> for std::sync::Arc<T> {
|
||||
fn layout (&self, to: [u16;4]) -> [u16;4] {
|
||||
Content::<TuiOut>::layout(&**self, to)
|
||||
}
|
||||
fn render (&self, to: &mut TuiOut) {
|
||||
Content::<TuiOut>::render(&**self, to)
|
||||
}
|
||||
}
|
||||
|
||||
impl Content<TuiOut> for std::sync::RwLock<String> {
|
||||
fn layout (&self, to: [u16;4]) -> [u16;4] {
|
||||
Content::<TuiOut>::layout(&self.read().unwrap(), to)
|
||||
}
|
||||
fn render (&self, to: &mut TuiOut) {
|
||||
Content::<TuiOut>::render(&self.read().unwrap(), to)
|
||||
}
|
||||
}
|
||||
|
||||
impl Content<TuiOut> for std::sync::RwLockReadGuard<'_, String> {
|
||||
fn layout (&self, to: [u16;4]) -> [u16;4] {
|
||||
Content::<TuiOut>::layout(&**self, to)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue