[librsvg/librsvg-2.46] rect: shorten code using iterator methods



commit 9d65a2048ece9bdc3f2a503b2669ac170d4ab6b8
Author: Paolo Borelli <pborelli gnome org>
Date:   Sun Oct 13 12:23:09 2019 +0200

    rect: shorten code using iterator methods

 rsvg_internals/src/rect.rs | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/rsvg_internals/src/rect.rs b/rsvg_internals/src/rect.rs
index f1ab4ed5..bf7ff707 100644
--- a/rsvg_internals/src/rect.rs
+++ b/rsvg_internals/src/rect.rs
@@ -80,9 +80,7 @@ impl RectangleExt for cairo::Rectangle {
             (x, y, x, y)
         };
 
-        for i in 1..4 {
-            let (x, y) = points[i];
-
+        for &(x, y) in points.iter().take(4).skip(1) {
             if x < xmin {
                 xmin = x;
             }


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