Implement `Drawable` for slices of drawables
This commit is contained in:
parent
59b1e90661
commit
2ca73036ab
|
@ -25,3 +25,12 @@ where
|
|||
T::draw(self, frame)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Drawable for &[T]
|
||||
where
|
||||
T: Drawable,
|
||||
{
|
||||
fn draw(&self, frame: &mut Frame) {
|
||||
self.iter().for_each(|drawable| drawable.draw(frame));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue