[librsvg/rustify-rsvg-convert] Avoid a couple of temporary values



commit 80c26d71bc73da1ed658df13304157139d29a7de
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Feb 2 15:18:26 2021 -0600

    Avoid a couple of temporary values

 src/bin/rsvg-convert.rs | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/src/bin/rsvg-convert.rs b/src/bin/rsvg-convert.rs
index a40df856..43cd4644 100644
--- a/src/bin/rsvg-convert.rs
+++ b/src/bin/rsvg-convert.rs
@@ -458,9 +458,9 @@ impl Converter {
     }
 
     fn natural_size(&self, renderer: &CairoRenderer, input: &Input) -> Result<Size, Error> {
-        let (w, h) = renderer
+        renderer
             .legacy_layer_geometry(self.export_id.as_deref())
-            .map(|(ink_r, _)| (ink_r.width, ink_r.height))
+            .map(|(ink_r, _)| Size::new(ink_r.width, ink_r.height))
             .map_err(|e| match e {
                 RenderingError::IdNotFound => error!(
                     "File {} does not have an object with id \"{}\")",
@@ -468,9 +468,7 @@ impl Converter {
                     self.export_id.as_deref().unwrap()
                 ),
                 _ => error!("Error rendering SVG {}: {}", input, e),
-            })?;
-
-        Ok(Size::new(w, h))
+            })
     }
 
     fn final_size(


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