commit fc37a37b91a499da79645e3a79b4b4fcdf941cc9
parent 24def48f8b968707a22e429d007e1467e009904e
Author: Tom Schuster <evilpies@gmail.com>
Date: Thu, 20 Nov 2025 00:07:49 +0000
Bug 2001202 - Two small style mako.rs code improvements. r=emilio,firefox-style-system-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D273316
Diffstat:
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/servo/components/style/gecko/pseudo_element_definition.mako.rs b/servo/components/style/gecko/pseudo_element_definition.mako.rs
@@ -158,12 +158,7 @@ impl PseudoElement {
}),
% endif
% endfor
- PseudoStyleType::highlight => {
- match functional_pseudo_parameter {
- Some(p) => Some(PseudoElement::Highlight(p)),
- None => None
- }
- }
+ PseudoStyleType::highlight => functional_pseudo_parameter.map(PseudoElement::Highlight),
_ => None,
}
}
diff --git a/servo/components/style/properties/longhands/font.mako.rs b/servo/components/style/properties/longhands/font.mako.rs
@@ -472,7 +472,7 @@ pub mod system_font {
// Checking if context.cached_system_font.is_none() isn't enough,
// if animating from one system font to another the cached system font
// may change
- if Some(system) != context.cached_system_font.as_ref().map(|x| x.system_font) {
+ if context.cached_system_font.as_ref().is_none_or(|x| x.system_font != system) {
let computed = system.to_computed_value(context);
context.cached_system_font = Some(computed);
}