mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Replace uses of for foo in bar.iter()
and for foo in bar.iter_mut()
closes #7197
This commit is contained in:
parent
13e7de482c
commit
0038580abf
55 changed files with 141 additions and 154 deletions
|
@ -60,7 +60,7 @@ pub fn process_new_animations(rw_data: &mut LayoutTaskData, pipeline_id: Pipelin
|
|||
|
||||
// Expire old running animations.
|
||||
let now = clock_ticks::precise_time_s();
|
||||
for (_, running_animations) in running_animations.iter_mut() {
|
||||
for (_, running_animations) in &mut running_animations {
|
||||
running_animations.retain(|running_animation| now < running_animation.end_time);
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ pub fn recalc_style_for_animations(flow: &mut Flow,
|
|||
let mut damage = RestyleDamage::empty();
|
||||
flow.mutate_fragments(&mut |fragment| {
|
||||
if let Some(ref animations) = animations.get(&OpaqueNode(fragment.node.id())) {
|
||||
for animation in animations.iter() {
|
||||
for animation in *animations {
|
||||
let now = clock_ticks::precise_time_s();
|
||||
let mut progress = (now - animation.start_time) / animation.duration();
|
||||
if progress > 1.0 {
|
||||
|
@ -130,4 +130,3 @@ pub fn tick_all_animations(layout_task: &LayoutTask, rw_data: &mut LayoutTaskDat
|
|||
|
||||
layout_task.script_chan.send(ConstellationControlMsg::TickAllAnimations(layout_task.id)).unwrap();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue