Implement `Drawable` for slices of drawables

This commit is contained in:
Héctor Ramón Jiménez 2020-04-28 03:19:29 +02:00
parent 59b1e90661
commit 2ca73036ab
1 changed files with 9 additions and 0 deletions

View File

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