[librsvg] drawing_ctx: shorten code



commit d515522df0030386ef02c9b3c97127cb8a93d49a
Author: Paolo Borelli <pborelli gnome org>
Date:   Mon Dec 30 19:47:07 2019 +0100

    drawing_ctx: shorten code

 rsvg_internals/src/drawing_ctx.rs | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index faeecd57..63122c74 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -294,10 +294,8 @@ impl DrawingCtx {
         preserve_aspect_ratio: AspectRatio,
         clip_mode: Option<ClipMode>,
     ) -> Option<ViewParams> {
-        if let Some(ref clip) = clip_mode {
-            if *clip == ClipMode::ClipToViewport {
-                self.clip(viewport);
-            }
+        if let Some(ClipMode::ClipToViewport) = clip_mode {
+            self.clip(viewport);
         }
 
         preserve_aspect_ratio
@@ -306,10 +304,8 @@ impl DrawingCtx {
                 self.cr.transform(matrix);
 
                 if let Some(vbox) = vbox {
-                    if let Some(ref clip) = clip_mode {
-                        if *clip == ClipMode::ClipToVbox {
-                            self.clip(vbox.0);
-                        }
+                    if let Some(ClipMode::ClipToVbox) = clip_mode {
+                        self.clip(vbox.0);
                     }
 
                     Some(self.push_view_box(vbox.0.width(), vbox.0.height()))


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