Auto merge of #9903 - servo:ref-filter-map, r=nox

Replace usage of deprecated std::cell::Ref::filter_map

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9903)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-03-08 08:52:45 +05:30
commit b6e469cbde
6 changed files with 23 additions and 2 deletions

View file

@ -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"]}

View file

@ -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()

View file

@ -59,6 +59,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;