Merge pull request #2915 from edwloef/children-exact-size
make `Layout::children` return an `ExactSizeIterator`
This commit is contained in:
commit
9c28319774
1 changed files with 3 additions and 1 deletions
|
|
@ -54,7 +54,9 @@ impl<'a> Layout<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns an iterator over the children of this [`Layout`].
|
/// 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| {
|
self.node.children().iter().map(move |node| {
|
||||||
Layout::with_offset(
|
Layout::with_offset(
|
||||||
Vector::new(self.position.x, self.position.y),
|
Vector::new(self.position.x, self.position.y),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue