Implement Drawable for slices of drawables
This commit is contained in:
parent
59b1e90661
commit
2ca73036ab
1 changed files with 9 additions and 0 deletions
|
|
@ -25,3 +25,12 @@ where
|
||||||
T::draw(self, frame)
|
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…
Add table
Add a link
Reference in a new issue