servo: Merge #11778 - Added DoubleEndedIterator for MutFlowListIterator (from avadacatavra:mutflowlistdoubleiter); r=Ms2ger
authorddh <dianehosfelt@gmail.com>
Fri, 17 Jun 2016 09:05:39 -0500
changeset 339088 5f0e2f081e4bb8e52cf16db943bac7d64b86ded4
parent 339087 57ab04b4e1d5ebecc5292e1c4a89130065cd8f16
child 339089 871a2979c2fb236fa8184974d480e4d2f2bfbd75
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMs2ger
servo: Merge #11778 - Added DoubleEndedIterator for MutFlowListIterator (from avadacatavra:mutflowlistdoubleiter); r=Ms2ger <!-- Please describe your changes on the following line: --> Added DoubleEndedIterator for MutFlowListIterator --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X ] `./mach build -d` does not report any errors - [X ] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 324548f9b67e51978cfc5da9d19676e942582d9d
servo/components/layout/flow_list.rs
--- a/servo/components/layout/flow_list.rs
+++ b/servo/components/layout/flow_list.rs
@@ -112,16 +112,22 @@ impl<'a> Iterator for FlowListIterator<'
 }
 
 impl<'a> DoubleEndedIterator for FlowListIterator<'a> {
     fn next_back(&mut self) -> Option<&'a Flow> {
         self.it.next_back().map(|x| &**x)
     }
 }
 
+impl<'a> DoubleEndedIterator for MutFlowListIterator<'a> {
+    fn next_back(&mut self) -> Option<&'a mut Flow> {
+        self.it.next_back().map(flow_ref::deref_mut)
+    }
+}
+
 impl<'a> Iterator for MutFlowListIterator<'a> {
     type Item = &'a mut Flow;
     #[inline]
     fn next(&mut self) -> Option<&'a mut Flow> {
         self.it.next().map(flow_ref::deref_mut)
     }
 
     #[inline]