aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/flow_list.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout/flow_list.rs')
-rw-r--r--components/layout/flow_list.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/components/layout/flow_list.rs b/components/layout/flow_list.rs
index 36eac0fa666..1fc33b2e246 100644
--- a/components/layout/flow_list.rs
+++ b/components/layout/flow_list.rs
@@ -96,7 +96,7 @@ impl FlowList {
/// SECURITY-NOTE(pcwalton): This does not hand out `FlowRef`s by design. Do not add a method
/// to do so! See the comment above in `FlowList`.
#[inline]
- pub fn iter<'a>(&'a self) -> FlowListIterator {
+ pub fn iter(&self) -> FlowListIterator {
FlowListIterator {
it: self.flows.iter(),
}
@@ -141,6 +141,12 @@ impl FlowList {
}
}
+impl Default for FlowList {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl<'a> DoubleEndedIterator for FlowListIterator<'a> {
fn next_back(&mut self) -> Option<&'a dyn Flow> {
self.it.next_back().map(Deref::deref)
@@ -187,7 +193,7 @@ pub struct FlowListRandomAccessMut<'a> {
}
impl<'a> FlowListRandomAccessMut<'a> {
- pub fn get<'b>(&'b mut self, index: usize) -> &'b mut dyn Flow {
+ pub fn get(&mut self, index: usize) -> &mut dyn Flow {
while index >= self.cache.len() {
match self.iterator.next() {
None => panic!("Flow index out of range!"),