diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2016-05-20 22:34:42 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2016-05-26 23:55:37 +0200 |
commit | a20db08f06f93a693b9288728fc2a4a522f42344 (patch) | |
tree | 9ae55ee4960d528c5765b46af904f470e218a602 /components/script/dom/bindings/utils.rs | |
parent | adcecda04736623eb4325f7a29c009ddc6b71cd8 (diff) | |
download | servo-a20db08f06f93a693b9288728fc2a4a522f42344.tar.gz servo-a20db08f06f93a693b9288728fc2a4a522f42344.zip |
Remove Prefable::terminator 🤖
Diffstat (limited to 'components/script/dom/bindings/utils.rs')
-rw-r--r-- | components/script/dom/bindings/utils.rs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/components/script/dom/bindings/utils.rs b/components/script/dom/bindings/utils.rs index 607f74456d2..3ba5838a4fa 100644 --- a/components/script/dom/bindings/utils.rs +++ b/components/script/dom/bindings/utils.rs @@ -557,24 +557,17 @@ pub struct Prefable<T: 'static> { pub pref: Option<&'static str>, /// The underlying slice of specifications. pub specs: &'static [T], - /// Whether the specifications contain special terminating entries that should be - /// included or not. - pub terminator: bool, } impl<T> Prefable<T> { /// Retrieve the slice represented by this container, unless the condition /// guarding it is false. - pub fn specs(&self) -> &'static [T] { + pub fn specs(&self) -> Option<&'static [T]> { if let Some(pref) = self.pref { if !prefs::get_pref(pref).as_boolean().unwrap_or(false) { - return if self.terminator { - &self.specs[self.specs.len() - 1..] - } else { - &[] - }; + return None; } } - self.specs + Some(self.specs) } } |