this may actually be a performance regression, i'm only profiling once

This commit is contained in:
🪞👃🪞 2025-01-20 19:23:33 +01:00
parent 680a841e3f
commit f5d84c2450
2 changed files with 65 additions and 31 deletions

View file

@ -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)