mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
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)
This commit is contained in:
parent
f4b526cfb4
commit
067a22a868
32 changed files with 76 additions and 78 deletions
|
@ -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]);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue