style: Use Option::as_deref() in style code.

And drive-by simplify another function that was only doing
Option::clone().

Differential Revision: https://phabricator.services.mozilla.com/D92839
This commit is contained in:
Emilio Cobos Álvarez 2020-10-08 09:42:49 +00:00
parent 379fb984f1
commit 384fd59ad0
4 changed files with 10 additions and 16 deletions

View file

@ -351,10 +351,7 @@ where
rule_inclusion,
PseudoElementResolution::IfApplicable,
)
.resolve_primary_style(
style.as_ref().map(|s| &**s),
layout_parent_style.as_ref().map(|s| &**s),
);
.resolve_primary_style(style.as_deref(), layout_parent_style.as_deref());
let is_display_contents = primary_style.style().is_display_contents();
@ -373,10 +370,7 @@ where
rule_inclusion,
PseudoElementResolution::Force,
)
.resolve_style(
style.as_ref().map(|s| &**s),
layout_parent_style.as_ref().map(|s| &**s),
)
.resolve_style(style.as_deref(), layout_parent_style.as_deref())
.into()
}