diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2016-03-07 18:46:44 +0100 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2016-03-07 18:53:38 +0100 |
commit | 62034b956e0f31cde5de86b706646f08d2f5fe35 (patch) | |
tree | e59f6b24ca3605be3815053266b50fbe76d21e16 /components/script | |
parent | 743e0c9c878a78da873fed4edaa9c8284b2fd12d (diff) | |
download | servo-62034b956e0f31cde5de86b706646f08d2f5fe35.tar.gz servo-62034b956e0f31cde5de86b706646f08d2f5fe35.zip |
Replace usage of deprecated std::cell::Ref::filter_map
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/Cargo.toml | 1 | ||||
-rw-r--r-- | components/script/dom/element.rs | 5 | ||||
-rw-r--r-- | components/script/lib.rs | 1 |
3 files changed, 5 insertions, 2 deletions
diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml index 8f6cc070382..8b5b4558a37 100644 --- a/components/script/Cargo.toml +++ b/components/script/Cargo.toml @@ -82,6 +82,7 @@ num = "0.1.24" rand = "0.3" phf = "0.7.13" phf_macros = "0.7.13" +ref_filter_map = "1.0" ref_slice = "0.1.0" rustc-serialize = "0.3" selectors = {version = "0.5", features = ["heap_size"]} diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 2949c1d2cca..3eec2575bc3 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -66,6 +66,7 @@ use html5ever::serialize::SerializeOpts; use html5ever::serialize::TraversalScope; use html5ever::serialize::TraversalScope::{ChildrenOnly, IncludeNode}; use html5ever::tree_builder::{LimitedQuirks, NoQuirks, Quirks}; +use ref_filter_map::ref_filter_map; use selectors::matching::{DeclarationBlock, ElementFlags, matches}; use selectors::matching::{HAS_SLOW_SELECTOR, HAS_EDGE_CHILD_SELECTOR, HAS_SLOW_SELECTOR_LATER_SIBLINGS}; use selectors::matching::{common_style_affecting_attributes, rare_style_affecting_attributes}; @@ -751,7 +752,7 @@ impl Element { pub fn get_inline_style_declaration(&self, property: &Atom) -> Option<Ref<PropertyDeclaration>> { - Ref::filter_map(self.style_attribute.borrow(), |inline_declarations| { + ref_filter_map(self.style_attribute.borrow(), |inline_declarations| { inline_declarations.as_ref().and_then(|declarations| { declarations.normal .iter() @@ -764,7 +765,7 @@ impl Element { pub fn get_important_inline_style_declaration(&self, property: &Atom) -> Option<Ref<PropertyDeclaration>> { - Ref::filter_map(self.style_attribute.borrow(), |inline_declarations| { + ref_filter_map(self.style_attribute.borrow(), |inline_declarations| { inline_declarations.as_ref().and_then(|declarations| { declarations.important .iter() diff --git a/components/script/lib.rs b/components/script/lib.rs index 93ba1dba8a4..3476a163d36 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -60,6 +60,7 @@ extern crate phf; #[macro_use] extern crate profile_traits; extern crate rand; +extern crate ref_filter_map; extern crate ref_slice; extern crate rustc_serialize; extern crate script_traits; |