mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #18494 - frewsxcv:frewsxcv-size-hint, r=jdm
Implement `size_hint` for more iterators. ``` implement size hint for more iterators because why not we like fast things ``` <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18494) <!-- Reviewable:end -->
This commit is contained in:
commit
bb2030a493
8 changed files with 36 additions and 0 deletions
|
@ -765,6 +765,10 @@ impl<'a> Iterator for AbsoluteDescendantIter<'a> {
|
|||
fn next(&mut self) -> Option<&'a mut Flow> {
|
||||
self.iter.next().map(|info| FlowRef::deref_mut(&mut info.flow))
|
||||
}
|
||||
|
||||
fn size_hint(&self) -> (usize, Option<usize>) {
|
||||
self.iter.size_hint()
|
||||
}
|
||||
}
|
||||
|
||||
pub type AbsoluteDescendantOffsetIter<'a> = Zip<AbsoluteDescendantIter<'a>, IterMut<'a, Au>>;
|
||||
|
|
|
@ -979,6 +979,10 @@ impl InlineFlow {
|
|||
self.iter.next()
|
||||
}
|
||||
}
|
||||
|
||||
fn size_hint(&self) -> (usize, Option<usize>) {
|
||||
self.iter.size_hint()
|
||||
}
|
||||
}
|
||||
|
||||
// If the bidi embedding direction is opposite the layout direction, lay out this
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue