[librsvg] length.rs: Implement trait Default for RsvgLength



commit 458c7ff1e51ee730380c50690591c38207ad4b54
Author: Federico Mena Quintero <federico gnome org>
Date:   Mon Feb 20 16:04:24 2017 -0600

    length.rs: Implement trait Default for RsvgLength

 rust/src/length.rs |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/rust/src/length.rs b/rust/src/length.rs
index 7060e3b..1b05d9c 100644
--- a/rust/src/length.rs
+++ b/rust/src/length.rs
@@ -44,6 +44,16 @@ pub struct RsvgLength {
     dir: LengthDir
 }
 
+impl Default for RsvgLength {
+    fn default () -> RsvgLength {
+        RsvgLength {
+            length: 0.0,
+            unit:   LengthUnit::Default,
+            dir:    LengthDir::Both
+        }
+    }
+}
+
 const POINTS_PER_INCH: f64 = 72.0;
 const CM_PER_INCH:     f64 = 2.54;
 const MM_PER_INCH:     f64 = 25.4;


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