summaryrefslogtreecommitdiff
path: root/rsvg_internals
diff options
context:
space:
mode:
authorSven Neumann <sven@svenfoo.org>2020-08-24 14:45:00 +0200
committerSven Neumann <sven@svenfoo.org>2020-08-24 14:48:28 +0200
commit67f1c91914c43e75984a1ff618b043e13d1b9baf (patch)
tree69e47176734af26c675c5ea47916897864b8da51 /rsvg_internals
parent6ba302f2a70b20292ac9784935c26992c51befa1 (diff)
downloadlibrsvg-67f1c91914c43e75984a1ff618b043e13d1b9baf.tar.gz
Minor style improvement suggested by clippy
See https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_if_conditions Also suppres a clippy warning about type complexity as the complexity is infered by the cssparser crate.
Diffstat (limited to 'rsvg_internals')
-rw-r--r--rsvg_internals/src/css.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/rsvg_internals/src/css.rs b/rsvg_internals/src/css.rs
index a6de029b..da32460e 100644
--- a/rsvg_internals/src/css.rs
+++ b/rsvg_internals/src/css.rs
@@ -267,6 +267,7 @@ impl<'i> AtRuleParser<'i> for RuleParser {
type AtRule = Rule;
type Error = ParseErrorKind<'i>;
+ #[allow(clippy::type_complexity)]
fn parse_prelude<'t>(
&mut self,
name: CowRcStr<'i>,
@@ -709,14 +710,16 @@ impl Stylesheet {
for rule in &self.qualified_rules {
for selector in &rule.selectors.0 {
// This magic call is stolen from selectors::matching::matches_selector_list()
- if selectors::matching::matches_selector(
+ let matches = selectors::matching::matches_selector(
selector,
0,
None,
&RsvgElement(node.clone()),
match_ctx,
&mut |_, _| {},
- ) {
+ );
+
+ if matches {
for decl in rule.declarations.iter() {
acc.push(Match {
declaration: decl,