diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-07-03 08:19:04 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-03 08:19:04 -0700 |
commit | b0a8ce5341f5148e36523fee0b0fcbc2684c0a68 (patch) | |
tree | f7c3746dbfa55e7ba5d863a921b7a89211974858 /components/script/dom/testbinding.rs | |
parent | a9c58c99fb897f95f37d893ecb3994864ef58da9 (diff) | |
parent | d9c9d4ab369c09dae378cb886b9dc7409f114c8f (diff) | |
download | servo-b0a8ce5341f5148e36523fee0b0fcbc2684c0a68.tar.gz servo-b0a8ce5341f5148e36523fee0b0fcbc2684c0a68.zip |
Auto merge of #12178 - frewsxcv:prefs, r=emilio
Refactor `util::prefs` operations to be methods on static struct.
<!-- Please describe your changes on the following line: -->
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).
<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because _____
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12178)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/testbinding.rs')
-rw-r--r-- | components/script/dom/testbinding.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script/dom/testbinding.rs b/components/script/dom/testbinding.rs index 8cd53ee57fb..ffe8afc0b89 100644 --- a/components/script/dom/testbinding.rs +++ b/components/script/dom/testbinding.rs @@ -29,7 +29,7 @@ use js::jsval::{JSVal, NullValue}; use std::borrow::ToOwned; use std::ptr; use std::rc::Rc; -use util::prefs::get_pref; +use util::prefs::PREFS; #[dom_struct] pub struct TestBinding { @@ -558,10 +558,10 @@ impl TestBindingMethods for TestBinding { fn PassVariadicAny(&self, _: *mut JSContext, _: Vec<HandleValue>) {} fn PassVariadicObject(&self, _: *mut JSContext, _: Vec<*mut JSObject>) {} fn BooleanMozPreference(&self, pref_name: DOMString) -> bool { - get_pref(pref_name.as_ref()).as_boolean().unwrap_or(false) + PREFS.get(pref_name.as_ref()).as_boolean().unwrap_or(false) } fn StringMozPreference(&self, pref_name: DOMString) -> DOMString { - get_pref(pref_name.as_ref()).as_string().map(|s| DOMString::from(s)).unwrap_or_else(|| DOMString::new()) + PREFS.get(pref_name.as_ref()).as_string().map(|s| DOMString::from(s)).unwrap_or_else(|| DOMString::new()) } fn PrefControlledAttributeDisabled(&self) -> bool { false } fn PrefControlledAttributeEnabled(&self) -> bool { false } |