Skip to content

Commit

Permalink
Use while let{} instead of loop{match{}} in TimerScheduler::run_event…
Browse files Browse the repository at this point in the history
…_loop()
  • Loading branch information
rnestler committed Nov 9, 2015
1 parent f39faaf commit 004ed44
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions components/compositing/timer_scheduler.rs
Expand Up @@ -126,11 +126,10 @@ impl TimerScheduler {
}

fn run_event_loop(&self) {
loop {
match self.receive_next_task() {
Some(Task::HandleRequest(request)) => self.handle_request(request),
Some(Task::DispatchDueEvents) => self.dispatch_due_events(),
None => break,
while let Some(task) = self.receive_next_task() {
match task {
Task::HandleRequest(request) => self.handle_request(request),
Task::DispatchDueEvents => self.dispatch_due_events(),
}
}
}
Expand Down

0 comments on commit 004ed44

Please sign in to comment.