[librsvg: 4/9] Default impl for BoundingBox can be created by #[derive(Default)]



commit 73ccbae903203edb312de341e696c931f0678615
Author: Sven Neumann <sven svenfoo org>
Date:   Thu Jan 30 08:44:05 2020 +0100

    Default impl for BoundingBox can be created by #[derive(Default)]

 rsvg_internals/src/bbox.rs | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
---
diff --git a/rsvg_internals/src/bbox.rs b/rsvg_internals/src/bbox.rs
index 7a8efaec..8b6e50da 100644
--- a/rsvg_internals/src/bbox.rs
+++ b/rsvg_internals/src/bbox.rs
@@ -3,23 +3,13 @@
 use crate::rect::Rect;
 use crate::transform::Transform;
 
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Default, Copy, Clone)]
 pub struct BoundingBox {
     pub transform: Transform,
     pub rect: Option<Rect>,     // without stroke
     pub ink_rect: Option<Rect>, // with stroke
 }
 
-impl Default for BoundingBox {
-    fn default() -> Self {
-        BoundingBox {
-            transform: Default::default(),
-            rect: None,
-            ink_rect: None,
-        }
-    }
-}
-
 impl BoundingBox {
     pub fn new() -> BoundingBox {
         Default::default()


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