diff options
author | João Oliveira <hello@jxs.pt> | 2015-08-18 01:36:04 +0100 |
---|---|---|
committer | João Oliveira <hello@jxs.pt> | 2015-08-18 01:46:11 +0100 |
commit | 067a22a868fb59be92df4f07c5ca54669dc1c229 (patch) | |
tree | 6a35298b4b3aa43c9d896f5cb7d63903611fb246 /components/layout | |
parent | f4b526cfb4ea1ef263ff029650c74ff50a74d5db (diff) | |
download | servo-067a22a868fb59be92df4f07c5ca54669dc1c229.tar.gz servo-067a22a868fb59be92df4f07c5ca54669dc1c229.zip |
Replace uses of `for foo in bar.iter()`,
and `for foo in bar.iter_mut(), and for foo in bar.into_iter()
(continuation of #7197)
Diffstat (limited to 'components/layout')
-rw-r--r-- | components/layout/animation.rs | 4 | ||||
-rw-r--r-- | components/layout/construct.rs | 8 | ||||
-rw-r--r-- | components/layout/flow.rs | 2 | ||||
-rw-r--r-- | components/layout/generated_content.rs | 5 | ||||
-rw-r--r-- | components/layout/inline.rs | 4 | ||||
-rw-r--r-- | components/layout/parallel.rs | 4 |
6 files changed, 13 insertions, 14 deletions
diff --git a/components/layout/animation.rs b/components/layout/animation.rs index c9b78a50ef0..ab11433fdfa 100644 --- a/components/layout/animation.rs +++ b/components/layout/animation.rs @@ -29,7 +29,7 @@ pub fn start_transitions_if_applicable(new_animations_sender: &Sender<Animation> for i in 0..new_style.get_animation().transition_property.0.len() { // Create any property animations, if applicable. let property_animations = PropertyAnimation::from_transition(i, old_style, new_style); - for property_animation in property_animations.into_iter() { + for property_animation in property_animations { // Set the property to the initial value. property_animation.update(new_style, 0.0); @@ -65,7 +65,7 @@ pub fn process_new_animations(rw_data: &mut LayoutTaskData, pipeline_id: Pipelin } // Add new running animations. - for new_running_animation in new_running_animations.into_iter() { + for new_running_animation in new_running_animations { match running_animations.entry(OpaqueNode(new_running_animation.node)) { Entry::Vacant(entry) => { entry.insert(vec![new_running_animation]); diff --git a/components/layout/construct.rs b/components/layout/construct.rs index c9934510424..658a88a0296 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -548,7 +548,7 @@ impl<'a> FlowConstructor<'a> { fragments: successor_fragments, })) => { // Add any {ib} splits. - for split in splits.into_iter() { + for split in splits { // Pull apart the {ib} split object and push its predecessor fragments // onto the list. let InlineBlockSplit { @@ -722,7 +722,7 @@ impl<'a> FlowConstructor<'a> { let mut style = (*style).clone(); properties::modify_style_for_text(&mut style); - for content_item in text_content.into_iter() { + for content_item in text_content { let specific = match content_item { ContentItem::String(string) => { let info = UnscannedTextFragmentInfo::from_text(string); @@ -765,7 +765,7 @@ impl<'a> FlowConstructor<'a> { node: &ThreadSafeLayoutNode, fragment_accumulator: &mut InlineFragmentsAccumulator, opt_inline_block_splits: &mut LinkedList<InlineBlockSplit>) { - for split in splits.into_iter() { + for split in splits { let InlineBlockSplit { predecessors, flow: kid_flow @@ -1038,7 +1038,7 @@ impl<'a> FlowConstructor<'a> { node: &ThreadSafeLayoutNode) { let mut anonymous_flow = flow.generate_missing_child_flow(node); let mut consecutive_siblings = vec!(); - for kid_flow in child_flows.into_iter() { + for kid_flow in child_flows { if anonymous_flow.need_anonymous_flow(&*kid_flow) { consecutive_siblings.push(kid_flow); continue; diff --git a/components/layout/flow.rs b/components/layout/flow.rs index 6b11bee1f8c..21af4e9e3ee 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -727,7 +727,7 @@ impl AbsoluteDescendants { /// /// Ignore any static y offsets, because they are None before layout. pub fn push_descendants(&mut self, given_descendants: AbsoluteDescendants) { - for elem in given_descendants.descendant_links.into_iter() { + for elem in given_descendants.descendant_links { self.descendant_links.push(elem); } } diff --git a/components/layout/generated_content.rs b/components/layout/generated_content.rs index a761ff8fc0b..3b65afdbfdd 100644 --- a/components/layout/generated_content.rs +++ b/components/layout/generated_content.rs @@ -277,11 +277,10 @@ impl<'a,'b> ResolveGeneratedContentFragmentMutator<'a,'b> { self.traversal.counters.insert((*counter_name).clone(), counter); } - for &(ref counter_name, value) in fragment.style() + for &(ref counter_name, value) in &fragment.style() .get_counters() .counter_increment - .0 - .iter() { + .0 { if let Some(ref mut counter) = self.traversal.counters.get_mut(counter_name) { counter.increment(self.level, value); continue diff --git a/components/layout/inline.rs b/components/layout/inline.rs index 39a000d742e..ecb06a0b8e8 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -1121,7 +1121,7 @@ impl InlineFlow { let run = Arc::make_unique(&mut scanned_text_fragment_info.run); { let glyph_runs = Arc::make_unique(&mut run.glyphs); - for mut glyph_run in glyph_runs.iter_mut() { + for mut glyph_run in &mut *glyph_runs { let mut range = glyph_run.range.intersect(&fragment_range); if range.is_empty() { continue @@ -1226,7 +1226,7 @@ impl InlineFlow { for frag in &self.fragments.fragments { match frag.inline_context { Some(ref inline_context) => { - for node in inline_context.nodes.iter() { + for node in &inline_context.nodes { let font_style = node.style.get_font_arc(); let font_metrics = text::font_metrics_for_style(font_context, font_style); let line_height = text::line_height_from_style(&*node.style, &font_metrics); diff --git a/components/layout/parallel.rs b/components/layout/parallel.rs index 60d8c9de306..c936dd00a16 100644 --- a/components/layout/parallel.rs +++ b/components/layout/parallel.rs @@ -114,7 +114,7 @@ pub trait ParallelPreorderDomTraversal : PreorderDomTraversal { top_down_func: ChunkedDomTraversalFunction, bottom_up_func: DomTraversalFunction) { let mut discovered_child_nodes = Vec::new(); - for unsafe_node in unsafe_nodes.0.into_iter() { + for unsafe_node in *unsafe_nodes.0 { // Get a real layout node. let node: LayoutNode = unsafe { layout_node_from_unsafe_layout_node(&unsafe_node) @@ -295,7 +295,7 @@ trait ParallelPreorderFlowTraversal : PreorderFlowTraversal { top_down_func: ChunkedFlowTraversalFunction, bottom_up_func: FlowTraversalFunction) { let mut discovered_child_flows = Vec::new(); - for mut unsafe_flow in unsafe_flows.0.into_iter() { + for mut unsafe_flow in *unsafe_flows.0 { let mut had_children = false; unsafe { // Get a real flow. |