Refactor util::prefs operations to be methods on static struct.

This commit is contained in:
Corey Farwell 2016-07-02 13:51:17 -04:00
parent 307844a8c1
commit 22928f50ac
30 changed files with 166 additions and 162 deletions

View file

@ -22,7 +22,7 @@ use std::cmp::{self, Ord, Ordering};
use std::collections::HashMap;
use std::default::Default;
use std::rc::Rc;
use util::prefs::get_pref;
use util::prefs::PREFS;
#[derive(JSTraceable, PartialEq, Eq, Copy, Clone, HeapSizeOf, Hash, PartialOrd, Ord, Debug)]
pub struct OneshotTimerHandle(i32);
@ -214,7 +214,7 @@ impl OneshotTimers {
}
pub fn slow_down(&self) {
let duration = get_pref("js.timers.minimum_duration").as_u64().unwrap_or(1000);
let duration = PREFS.get("js.timers.minimum_duration").as_u64().unwrap_or(1000);
self.js_timers.set_min_duration(MsDuration::new(duration));
}