[librsvg] cargo fmt now, for good measure :)



commit 223cd7e2c79b65a8bb1036690ecabcd4eecd3598
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Feb 20 18:26:40 2019 -0600

    cargo fmt now, for good measure :)

 librsvg_crate/examples/proportional.rs | 22 +++++++++---------
 rsvg_internals/src/cond.rs             | 41 +++++++++++++++++-----------------
 rsvg_internals/src/svg.rs              |  3 ++-
 3 files changed, 34 insertions(+), 32 deletions(-)
---
diff --git a/librsvg_crate/examples/proportional.rs b/librsvg_crate/examples/proportional.rs
index ee02f3ed..50284b08 100644
--- a/librsvg_crate/examples/proportional.rs
+++ b/librsvg_crate/examples/proportional.rs
@@ -34,16 +34,18 @@ fn main() {
 
     let surface = cairo::ImageSurface::create(cairo::Format::ARgb32, width, height).unwrap();
     let cr = cairo::Context::new(&surface);
-    renderer.render_element_to_viewport(
-        &cr,
-        None,
-        &cairo::Rectangle {
-            x: 0.0,
-            y: 0.0,
-            width: f64::from(width),
-            height: f64::from(height),
-        }
-    ).unwrap();
+    renderer
+        .render_element_to_viewport(
+            &cr,
+            None,
+            &cairo::Rectangle {
+                x: 0.0,
+                y: 0.0,
+                width: f64::from(width),
+                height: f64::from(height),
+            },
+        )
+        .unwrap();
 
     let mut file = BufWriter::new(File::create(output).unwrap());
 
diff --git a/rsvg_internals/src/cond.rs b/rsvg_internals/src/cond.rs
index 12730369..4099ec40 100644
--- a/rsvg_internals/src/cond.rs
+++ b/rsvg_internals/src/cond.rs
@@ -86,28 +86,27 @@ impl SystemLanguage {
     /// [`systemLanguage`]: 
https://www.w3.org/TR/SVG/struct.html#ConditionalProcessingSystemLanguageAttribute
     /// [BCP47]: http://www.ietf.org/rfc/bcp/bcp47.txt
     pub fn from_attribute(s: &str, locale: &Locale) -> Result<SystemLanguage, ValueErrorKind> {
-        s.split(',')
-            .map(LanguageTag::from_str)
-            .try_fold(
-                // start with no match
-                SystemLanguage(false),
-                // The accumulator is Result<SystemLanguage, ValueErrorKind>
-                |acc, tag_result| match tag_result {
-                    Ok(language_tag) => {
-                        let have_match = acc.0;
-                        if have_match {
-                            Ok(SystemLanguage(have_match))
-                        } else {
-                            locale_accepts_language_tag(locale, &language_tag)
-                                .map(|matches| SystemLanguage(matches))
-                        }
+        s.split(',').map(LanguageTag::from_str).try_fold(
+            // start with no match
+            SystemLanguage(false),
+            // The accumulator is Result<SystemLanguage, ValueErrorKind>
+            |acc, tag_result| match tag_result {
+                Ok(language_tag) => {
+                    let have_match = acc.0;
+                    if have_match {
+                        Ok(SystemLanguage(have_match))
+                    } else {
+                        locale_accepts_language_tag(locale, &language_tag)
+                            .map(|matches| SystemLanguage(matches))
                     }
-
-                    Err(e) => Err(ValueErrorKind::Parse(ParseError::new(
-                        &format!("invalid language tag: \"{}\"", e),
-                    ))),
-                },
-            )
+                }
+
+                Err(e) => Err(ValueErrorKind::Parse(ParseError::new(&format!(
+                    "invalid language tag: \"{}\"",
+                    e
+                )))),
+            },
+        )
     }
 }
 
diff --git a/rsvg_internals/src/svg.rs b/rsvg_internals/src/svg.rs
index f101f2c2..ec39f475 100644
--- a/rsvg_internals/src/svg.rs
+++ b/rsvg_internals/src/svg.rs
@@ -224,7 +224,8 @@ fn load_image(
                     data.data.len() as libc::c_ulong,
                     Some(glib_sys::g_free),
                     data_ptr as *mut _,
-                ).into();
+                )
+                .into();
 
                 if status != Status::Success {
                     return Err(LoadingError::Cairo(status));


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