[librsvg: 1/4] Minor style improvement suggested by clippy
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 1/4] Minor style improvement suggested by clippy
- Date: Mon, 24 Aug 2020 15:34:55 +0000 (UTC)
commit 67f1c91914c43e75984a1ff618b043e13d1b9baf
Author: Sven Neumann <sven svenfoo org>
Date: Mon Aug 24 14:45:00 2020 +0200
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.
rsvg_internals/src/css.rs | 7 +++++--
1 file 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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]