[librsvg/rustify-rsvg-convert: 4/4] rsvg-convert: fix clippy warnings




commit 1f2f80ebd5f82971f76f28323dd9ed33c80512ab
Author: Paolo Borelli <pborelli gnome org>
Date:   Sun Jan 17 14:29:35 2021 +0100

    rsvg-convert: fix clippy warnings

 src/bin/rsvg-convert.rs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/bin/rsvg-convert.rs b/src/bin/rsvg-convert.rs
index 0e5a32eb..f2ec0fef 100644
--- a/src/bin/rsvg-convert.rs
+++ b/src/bin/rsvg-convert.rs
@@ -380,7 +380,7 @@ impl Converter {
             // Create the surface once on the first input
             surface.get_or_init(|| self.create_surface(&renderer, input));
 
-            surface.get().map(|s| {
+            if let Some(s) = surface.get() {
                 s.render(
                     &renderer,
                     self.zoom,
@@ -388,13 +388,13 @@ impl Converter {
                     self.export_id.as_deref(),
                 )
                 .unwrap_or_else(|e| exit!("Error rendering SVG {}: {}", input, e))
-            });
+            };
         }
 
-        surface.take().map(|s| {
+        if let Some(s) = surface.take() {
             s.finish()
                 .unwrap_or_else(|e| exit!("Error saving output: {}", e))
-        });
+        };
     }
 
     fn create_surface(&self, renderer: &CairoRenderer, input: &Input) -> Surface {


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