[librsvg: 14/16] clippy: Allow a complex type




commit 8a3ad20cbae75b6f3cc87ef2246e82200f85f1aa
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu Sep 15 19:49:32 2022 -0500

    clippy: Allow a complex type
    
    Clippy would stop complaining with
    
      type FilterParseFn<'a, 'i> = &'a dyn Fn(&mut Parser<'i, '_>) -> Result<FilterFunction, ParseError<'i>>;
    
    But that's not easier to read than what there is right now.
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/747>

 src/filter_func.rs | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/src/filter_func.rs b/src/filter_func.rs
index 019303ec5..e931c8b17 100644
--- a/src/filter_func.rs
+++ b/src/filter_func.rs
@@ -608,19 +608,21 @@ impl Sepia {
 }
 
 impl Parse for FilterFunction {
+    #[allow(clippy::type_complexity)]
+    #[rustfmt::skip]
     fn parse<'i>(parser: &mut Parser<'i, '_>) -> Result<Self, crate::error::ParseError<'i>> {
         let loc = parser.current_source_location();
         let fns: Vec<(&str, &dyn Fn(&mut Parser<'i, '_>) -> _)> = vec![
-            ("blur", &parse_blur),
-            ("brightness", &parse_brightness),
-            ("contrast", &parse_contrast),
+            ("blur",        &parse_blur),
+            ("brightness",  &parse_brightness),
+            ("contrast",    &parse_contrast),
             ("drop-shadow", &parse_dropshadow),
-            ("grayscale", &parse_grayscale),
-            ("hue-rotate", &parse_huerotate),
-            ("invert", &parse_invert),
-            ("opacity", &parse_opacity),
-            ("saturate", &parse_saturate),
-            ("sepia", &parse_sepia),
+            ("grayscale",   &parse_grayscale),
+            ("hue-rotate",  &parse_huerotate),
+            ("invert",      &parse_invert),
+            ("opacity",     &parse_opacity),
+            ("saturate",    &parse_saturate),
+            ("sepia",       &parse_sepia),
         ];
 
         for (filter_name, parse_fn) in fns {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]