[librsvg: 1/2] Use `unwrap_or_default` instead `unwrap_or_else(default)`




commit d091046d1656812259569bb264f20ea19c74ab32
Author: Michael Howell <michael notriddle com>
Date:   Mon Oct 18 08:58:09 2021 -0700

    Use `unwrap_or_default` instead `unwrap_or_else(default)`
    
    This is a new lint introduced in Clippy for Rust 1.56.0
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/612>

 src/filters/bounds.rs | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/src/filters/bounds.rs b/src/filters/bounds.rs
index 48fe137e..6a6dd9d2 100644
--- a/src/filters/bounds.rs
+++ b/src/filters/bounds.rs
@@ -114,9 +114,7 @@ impl BoundsBuilder {
         // Convert into the surface coordinate system.
         let unclipped = self.transform.transform_rect(&rect);
 
-        let clipped = unclipped
-            .intersection(&effects_region)
-            .unwrap_or_else(Rect::default);
+        let clipped = unclipped.intersection(&effects_region).unwrap_or_default();
 
         Bounds { clipped, unclipped }
     }


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