mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-12 14:46:41 +01:00
arranger, transport: despaghettify
This commit is contained in:
parent
33bdf65e8d
commit
1104093395
10 changed files with 430 additions and 253 deletions
|
|
@ -16,7 +16,7 @@ impl<'a> Render for Collected<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
pub struct Collection<'a>(Vec<Collected<'a>>);
|
||||
pub struct Collection<'a>(pub Vec<Collected<'a>>);
|
||||
|
||||
impl<'a> Collection<'a> {
|
||||
pub fn new () -> Self {
|
||||
|
|
@ -27,6 +27,9 @@ impl<'a> Collection<'a> {
|
|||
pub trait Collect<'a> {
|
||||
fn add_box (self, item: Box<dyn Render + 'a>) -> Self;
|
||||
fn add_ref (self, item: &'a dyn Render) -> Self;
|
||||
fn add <T: Render + Sized + 'a> (self, item: T) -> Self where Self: Sized {
|
||||
self.add_box(Box::new(item))
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Collect<'a> for Collection<'a> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue