fix: collect enum, break: Render for Option<&T>

This commit is contained in:
🪞👃🪞 2024-08-21 18:22:35 +03:00
parent 72f47bc837
commit 33bdf65e8d
8 changed files with 37 additions and 33 deletions

View file

@ -25,12 +25,12 @@ impl<'a> Collection<'a> {
}
pub trait Collect<'a> {
fn add_box (self, item: Box<dyn Render>) -> Self;
fn add_box (self, item: Box<dyn Render + 'a>) -> Self;
fn add_ref (self, item: &'a dyn Render) -> Self;
}
impl<'a> Collect<'a> for Collection<'a> {
fn add_box (mut self, item: Box<dyn Render>) -> Self {
fn add_box (mut self, item: Box<dyn Render + 'a>) -> Self {
self.0.push(Collected::Box(item));
self
}