wip: borrow checker battles

This commit is contained in:
🪞👃🪞 2024-09-04 16:57:48 +03:00
parent 1d4db3c629
commit 7fbb40fad6
38 changed files with 778 additions and 708 deletions

View file

@ -9,18 +9,18 @@ impl<'a, T, U> Layered<'a, T, U> {
}
impl<'a, T, U> Collect<'a, T, U> for Layered<'a, T, U> {
fn add_box (mut self, item: Box<dyn Render<T, U> + 'a>) -> Self {
fn add_box (mut self, item: Box<dyn Render<'a, T, U> + 'a>) -> Self {
self.0 = self.0.add_box(item);
self
}
fn add_ref (mut self, item: &'a dyn Render<T, U>) -> Self {
fn add_ref (mut self, item: &'a dyn Render<'a, T, U>) -> Self {
self.0 = self.0.add_ref(item);
self
}
}
impl<'a, 'b> Render<TuiOutput<'b>, Rect> for Layered<'a, TuiOutput<'b>, Rect> {
fn render (&self, to: &mut TuiOutput<'b>) -> Perhaps<Rect> {
impl<'a, 'b> Render<'a, TuiOutput<'b>, Rect> for Layered<'a, TuiOutput<'b>, Rect> {
fn render (&self, to: &'a mut TuiOutput<'b>) -> Perhaps<Rect> {
let area = to.area;
for layer in self.0.0.iter() {
layer.render(to)?;