aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/timers.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/timers.rs')
-rw-r--r--components/script/timers.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/components/script/timers.rs b/components/script/timers.rs
index 8ed64c32d83..8cc317f83ac 100644
--- a/components/script/timers.rs
+++ b/components/script/timers.rs
@@ -83,7 +83,7 @@ pub struct TimerManager {
impl Drop for TimerManager {
fn drop(&mut self) {
- for (_, timer_handle) in self.active_timers.borrow_mut().iter_mut() {
+ for (_, timer_handle) in &mut *self.active_timers.borrow_mut() {
timer_handle.cancel();
}
}
@@ -125,12 +125,12 @@ impl TimerManager {
}
pub fn suspend(&self) {
- for (_, timer_handle) in self.active_timers.borrow_mut().iter_mut() {
+ for (_, timer_handle) in &mut *self.active_timers.borrow_mut() {
timer_handle.suspend();
}
}
pub fn resume(&self) {
- for (_, timer_handle) in self.active_timers.borrow_mut().iter_mut() {
+ for (_, timer_handle) in &mut *self.active_timers.borrow_mut() {
timer_handle.resume();
}
}
@@ -142,7 +142,7 @@ impl TimerManager {
timeout: i32,
is_interval: IsInterval,
source: TimerSource,
- script_chan: Box<ScriptChan+Send>)
+ script_chan: Box<ScriptChan + Send>)
-> i32 {
let duration_ms = cmp::max(0, timeout) as u32;
let handle = self.next_timer_handle.get();
@@ -222,8 +222,8 @@ impl TimerManager {
for _ in 0..arguments.len() {
timer.data.args.push(Heap::default());
}
- for i in 0..arguments.len() {
- timer.data.args.get_mut(i).unwrap().set(arguments[i].get());
+ for (i, item) in arguments.iter().enumerate() {
+ timer.data.args.get_mut(i).unwrap().set(item.get());
}
handle
}