make Layout::children return an ExactSizeIterator

This commit is contained in:
edwloef 2025-04-30 19:15:28 +02:00
parent fb5ac7dcb0
commit eee7c55d34
No known key found for this signature in database

View file

@ -54,7 +54,9 @@ impl<'a> Layout<'a> {
}
/// Returns an iterator over the children of this [`Layout`].
pub fn children(self) -> impl DoubleEndedIterator<Item = Layout<'a>> {
pub fn children(
self,
) -> impl DoubleEndedIterator<Item = Layout<'a>> + ExactSizeIterator {
self.node.children().iter().map(move |node| {
Layout::with_offset(
Vector::new(self.position.x, self.position.y),