[librsvg: 39/43] font_props: do not clone Copy values



commit 8f80655b85b81d98ae6d88f2b202e513a41e64e7
Author: Paolo Borelli <pborelli gnome org>
Date:   Sun Oct 13 12:50:49 2019 +0200

    font_props: do not clone Copy values

 rsvg_internals/src/font_props.rs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/rsvg_internals/src/font_props.rs b/rsvg_internals/src/font_props.rs
index 9ce3f3dd..20d3a30c 100644
--- a/rsvg_internals/src/font_props.rs
+++ b/rsvg_internals/src/font_props.rs
@@ -24,7 +24,7 @@ pub enum FontSizeSpec {
 impl FontSizeSpec {
     pub fn value(&self) -> LengthBoth {
         match self {
-            FontSizeSpec::Value(s) => s.clone(),
+            FontSizeSpec::Value(s) => *s,
             _ => unreachable!(),
         }
     }
@@ -47,7 +47,7 @@ impl FontSizeSpec {
             FontSizeSpec::Value(s) if s.unit() == LengthUnit::Percent => {
                 LengthBoth::new(size.length() * s.length(), size.unit())
             }
-            FontSizeSpec::Value(s) => s.clone(),
+            FontSizeSpec::Value(s) => *s,
         };
 
         FontSizeSpec::Value(new_size)
@@ -170,7 +170,7 @@ pub enum LetterSpacingSpec {
 impl LetterSpacingSpec {
     pub fn value(&self) -> LengthHorizontal {
         match self {
-            LetterSpacingSpec::Value(s) => s.clone(),
+            LetterSpacingSpec::Value(s) => *s,
             _ => unreachable!(),
         }
     }
@@ -178,7 +178,7 @@ impl LetterSpacingSpec {
     pub fn compute(&self) -> Self {
         let spacing = match self {
             LetterSpacingSpec::Normal => LengthHorizontal::new(0.0, LengthUnit::Px),
-            LetterSpacingSpec::Value(s) => s.clone(),
+            LetterSpacingSpec::Value(s) => *s,
         };
 
         LetterSpacingSpec::Value(spacing)


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