diff options
author | Corey Farwell <coreyf@rwell.org> | 2016-07-02 13:51:17 -0400 |
---|---|---|
committer | Corey Farwell <coreyf@rwell.org> | 2016-07-02 16:43:39 -0400 |
commit | 22928f50ace78091bcb434c61e731663dbf3e625 (patch) | |
tree | e94536bc35887e3f4a7c9e5dd5f7dc2d271b415f /components/script/dom/bindings/guard.rs | |
parent | 307844a8c17aedc369388baf4d98b0f82c3b695b (diff) | |
download | servo-22928f50ace78091bcb434c61e731663dbf3e625.tar.gz servo-22928f50ace78091bcb434c61e731663dbf3e625.zip |
Refactor `util::prefs` operations to be methods on static struct.
Diffstat (limited to 'components/script/dom/bindings/guard.rs')
-rw-r--r-- | components/script/dom/bindings/guard.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/components/script/dom/bindings/guard.rs b/components/script/dom/bindings/guard.rs index 40faebbd4f2..114045a62e8 100644 --- a/components/script/dom/bindings/guard.rs +++ b/components/script/dom/bindings/guard.rs @@ -5,7 +5,7 @@ //! Machinery to conditionally expose things. use js::jsapi::{HandleObject, JSContext}; -use util::prefs::get_pref; +use util::prefs::PREFS; /// A container with a condition. pub struct Guard<T: Clone + Copy> { @@ -47,7 +47,7 @@ pub enum Condition { impl Condition { unsafe fn is_satisfied(&self, cx: *mut JSContext, obj: HandleObject) -> bool { match *self { - Condition::Pref(name) => get_pref(name).as_boolean().unwrap_or(false), + Condition::Pref(name) => PREFS.get(name).as_boolean().unwrap_or(false), Condition::Func(f) => f(cx, obj), Condition::Satisfied => true, } |