[librsvg: 7/19] Avoid having if/else with the same body




commit 72d10c421b3df416b271e12a15cb49aea77695a0
Author: Sven Neumann <sven svenfoo org>
Date:   Thu Aug 20 23:09:30 2020 +0200

    Avoid having if/else with the same body
    
    See https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else

 rsvg_internals/src/structure.rs | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/rsvg_internals/src/structure.rs b/rsvg_internals/src/structure.rs
index 9533476dc..b34cc2f3b 100644
--- a/rsvg_internals/src/structure.rs
+++ b/rsvg_internals/src/structure.rs
@@ -243,13 +243,11 @@ impl Draw for Svg {
 
         let is_measuring_toplevel_svg = !has_parent && draw_ctx.is_measuring();
 
-        let (viewport, vbox) = if is_measuring_toplevel_svg {
+        let (viewport, vbox) = if is_measuring_toplevel_svg || has_parent {
             // We are obtaining the toplevel SVG's geometry.  This means, don't care about the
             // DrawingCtx's viewport, just use the SVG's intrinsic dimensions and see how far
             // it wants to extend.
             (svg_viewport, self.vbox)
-        } else if has_parent {
-            (svg_viewport, self.vbox)
         } else {
             (
                 // The client's viewport overrides the toplevel's x/y/w/h viewport


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