Merge pull request #2915 from edwloef/children-exact-size

make `Layout::children` return an `ExactSizeIterator`
This commit is contained in:
Héctor 2025-11-25 21:43:58 +01:00 committed by GitHub
commit 9c28319774
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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),