[librsvg] cargo fmt



commit 7069f9a165d8cba59778585b030f90cbbf1d0d88
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu Apr 26 09:12:27 2018 -0500

    cargo fmt

 rsvg_internals/build.rs               |  5 +++-
 rsvg_internals/src/coord_units.rs     |  2 +-
 rsvg_internals/src/length.rs          |  2 +-
 rsvg_internals/src/lib.rs             | 10 +++-----
 rsvg_internals/src/marker.rs          | 47 +++++++++++++++--------------------
 rsvg_internals/src/node.rs            |  2 +-
 rsvg_internals/src/paint_server.rs    | 17 +++----------
 rsvg_internals/src/property_macros.rs |  4 +--
 rsvg_internals/src/state.rs           |  2 +-
 rsvg_internals/src/viewbox.rs         |  2 +-
 10 files changed, 38 insertions(+), 55 deletions(-)
---
diff --git a/rsvg_internals/build.rs b/rsvg_internals/build.rs
index 49957447..60d44db0 100644
--- a/rsvg_internals/build.rs
+++ b/rsvg_internals/build.rs
@@ -168,7 +168,10 @@ fn generate_phf_of_svg_attributes() {
     let mut file = BufWriter::new(File::create(&path).unwrap());
 
     writeln!(&mut file, "#[repr(C)]").unwrap();
-    writeln!(&mut file, "#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]").unwrap();
+    writeln!(
+        &mut file,
+        "#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]"
+    ).unwrap();
     writeln!(&mut file, "pub enum Attribute {{").unwrap();
 
     for &(_, valname) in attribute_defs.iter() {
diff --git a/rsvg_internals/src/coord_units.rs b/rsvg_internals/src/coord_units.rs
index 0877ee58..650b209a 100644
--- a/rsvg_internals/src/coord_units.rs
+++ b/rsvg_internals/src/coord_units.rs
@@ -38,7 +38,7 @@ impl Parse for CoordUnits {
 /// specified `$default` value.
 #[macro_export]
 macro_rules! coord_units {
-    ($name: ident, $default: expr) => {
+    ($name:ident, $default:expr) => {
         #[derive(Debug, Copy, Clone, PartialEq, Eq)]
         struct $name(CoordUnits);
 
diff --git a/rsvg_internals/src/length.rs b/rsvg_internals/src/length.rs
index 131c7e20..0085f03a 100644
--- a/rsvg_internals/src/length.rs
+++ b/rsvg_internals/src/length.rs
@@ -535,7 +535,7 @@ mod tests {
     #[test]
     fn parses_named_sizes() {
         let names = vec![
-            "xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large"
+            "xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large",
         ];
 
         let mut previous_value: Option<f64> = None;
diff --git a/rsvg_internals/src/lib.rs b/rsvg_internals/src/lib.rs
index aba1a171..baf2a7a9 100644
--- a/rsvg_internals/src/lib.rs
+++ b/rsvg_internals/src/lib.rs
@@ -82,11 +82,7 @@ pub use node::{
 
 pub use opacity::{rsvg_css_parse_opacity, OpacityKind, OpacitySpec};
 
-pub use paint_server::{
-    rsvg_paint_server_parse,
-    rsvg_paint_server_ref,
-    rsvg_paint_server_unref,
-};
+pub use paint_server::{rsvg_paint_server_parse, rsvg_paint_server_ref, rsvg_paint_server_unref};
 
 pub use parsers::{rsvg_css_parse_number_list, rsvg_css_parse_number_optional_number};
 
@@ -121,10 +117,10 @@ pub use state::{
     rsvg_state_rust_get_clip_path,
     rsvg_state_rust_get_color,
     rsvg_state_rust_get_comp_op,
-    rsvg_state_rust_get_flood_color,
-    rsvg_state_rust_get_flood_opacity,
     rsvg_state_rust_get_enable_background,
     rsvg_state_rust_get_filter,
+    rsvg_state_rust_get_flood_color,
+    rsvg_state_rust_get_flood_opacity,
     rsvg_state_rust_get_mask,
     rsvg_state_rust_inherit_run,
     rsvg_state_rust_insert_important_style,
diff --git a/rsvg_internals/src/marker.rs b/rsvg_internals/src/marker.rs
index a4fa9af2..d9fc78fd 100644
--- a/rsvg_internals/src/marker.rs
+++ b/rsvg_internals/src/marker.rs
@@ -17,8 +17,8 @@ use iri::IRI;
 use length::{LengthDir, RsvgLength};
 use node::*;
 use parsers;
-use parsers::{parse, Parse};
 use parsers::ParseError;
+use parsers::{parse, Parse};
 use path_builder::*;
 use property_bag::PropertyBag;
 use state::{self, StrokeWidth};
@@ -1131,30 +1131,30 @@ mod directionality_tests {
 
     #[test]
     fn curve_has_directionality() {
-        let (v1x, v1y, v2x, v2y) =
-            super::get_segment_directionalities(&curve(1.0, 2.0, 3.0, 5.0, 8.0, 13.0, 20.0, 33.0))
-                .unwrap();
+        let (v1x, v1y, v2x, v2y) = super::get_segment_directionalities(&curve(
+            1.0, 2.0, 3.0, 5.0, 8.0, 13.0, 20.0, 33.0,
+        )).unwrap();
         assert_eq!((2.0, 3.0), (v1x, v1y));
         assert_eq!((12.0, 20.0), (v2x, v2y));
     }
 
     #[test]
     fn curves_with_loops_and_coincident_ends_have_directionality() {
-        let (v1x, v1y, v2x, v2y) =
-            super::get_segment_directionalities(&curve(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 1.0, 2.0))
-                .unwrap();
+        let (v1x, v1y, v2x, v2y) = super::get_segment_directionalities(&curve(
+            1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 1.0, 2.0,
+        )).unwrap();
         assert_eq!((2.0, 2.0), (v1x, v1y));
         assert_eq!((-4.0, -4.0), (v2x, v2y));
 
-        let (v1x, v1y, v2x, v2y) =
-            super::get_segment_directionalities(&curve(1.0, 2.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0))
-                .unwrap();
+        let (v1x, v1y, v2x, v2y) = super::get_segment_directionalities(&curve(
+            1.0, 2.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0,
+        )).unwrap();
         assert_eq!((2.0, 2.0), (v1x, v1y));
         assert_eq!((-2.0, -2.0), (v2x, v2y));
 
-        let (v1x, v1y, v2x, v2y) =
-            super::get_segment_directionalities(&curve(1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 1.0, 2.0))
-                .unwrap();
+        let (v1x, v1y, v2x, v2y) = super::get_segment_directionalities(&curve(
+            1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 1.0, 2.0,
+        )).unwrap();
         assert_eq!((2.0, 2.0), (v1x, v1y));
         assert_eq!((-2.0, -2.0), (v2x, v2y));
     }
@@ -1169,18 +1169,18 @@ mod directionality_tests {
 
     #[test]
     fn curve_with_123_coincident_has_directionality() {
-        let (v1x, v1y, v2x, v2y) =
-            super::get_segment_directionalities(&curve(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 40.0))
-                .unwrap();
+        let (v1x, v1y, v2x, v2y) = super::get_segment_directionalities(&curve(
+            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 40.0,
+        )).unwrap();
         assert_eq!((20.0, 40.0), (v1x, v1y));
         assert_eq!((20.0, 40.0), (v2x, v2y));
     }
 
     #[test]
     fn curve_with_234_coincident_has_directionality() {
-        let (v1x, v1y, v2x, v2y) =
-            super::get_segment_directionalities(&curve(20.0, 40.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0))
-                .unwrap();
+        let (v1x, v1y, v2x, v2y) = super::get_segment_directionalities(&curve(
+            20.0, 40.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+        )).unwrap();
 
         assert_eq!((-20.0, -40.0), (v1x, v1y));
         assert_eq!((-20.0, -40.0), (v2x, v2y));
@@ -1189,14 +1189,7 @@ mod directionality_tests {
     #[test]
     fn curve_with_12_34_coincident_has_directionality() {
         let (v1x, v1y, v2x, v2y) = super::get_segment_directionalities(&curve(
-            20.0,
-            40.0,
-            20.0,
-            40.0,
-            60.0,
-            70.0,
-            60.0,
-            70.0,
+            20.0, 40.0, 20.0, 40.0, 60.0, 70.0, 60.0, 70.0,
         )).unwrap();
 
         assert_eq!((40.0, 30.0), (v1x, v1y));
diff --git a/rsvg_internals/src/node.rs b/rsvg_internals/src/node.rs
index 93b710d9..a150d689 100644
--- a/rsvg_internals/src/node.rs
+++ b/rsvg_internals/src/node.rs
@@ -544,8 +544,8 @@ mod tests {
     use super::*;
     use drawing_ctx::RsvgDrawingCtx;
     use handle::RsvgHandle;
-    use std::{mem, ptr};
     use std::rc::Rc;
+    use std::{mem, ptr};
 
     struct TestNodeImpl {}
 
diff --git a/rsvg_internals/src/paint_server.rs b/rsvg_internals/src/paint_server.rs
index e427a573..6d427b5d 100644
--- a/rsvg_internals/src/paint_server.rs
+++ b/rsvg_internals/src/paint_server.rs
@@ -74,7 +74,7 @@ impl Parse for PaintServer {
 
             Ok(PaintServer::Iri {
                 iri: String::from(url.as_ref()),
-                alternate: alternate,
+                alternate,
             })
         } else {
             cssparser::Color::parse(&mut parser)
@@ -190,10 +190,7 @@ pub fn _set_source_rsvg_paint_server(
                     || node.get_type() == NodeType::RadialGradient
                 {
                     had_paint_server = gradient::gradient_resolve_fallbacks_and_set_pattern(
-                        &node,
-                        c_ctx,
-                        opacity,
-                        bbox,
+                        &node, c_ctx, opacity, bbox,
                     );
                 } else if node.get_type() == NodeType::Pattern {
                     had_paint_server =
@@ -290,10 +287,7 @@ mod tests {
             Ok(PaintServer::Iri {
                 iri: "#link".to_string(),
                 alternate: Some(cssparser::Color::RGBA(cssparser::RGBA::new(
-                    255,
-                    128,
-                    64,
-                    255
+                    255, 128, 64, 255
                 ))),
             },)
         );
@@ -303,10 +297,7 @@ mod tests {
             Ok(PaintServer::Iri {
                 iri: "#link".to_string(),
                 alternate: Some(cssparser::Color::RGBA(cssparser::RGBA::new(
-                    255,
-                    128,
-                    64,
-                    128
+                    255, 128, 64, 128
                 ))),
             },)
         );
diff --git a/rsvg_internals/src/property_macros.rs b/rsvg_internals/src/property_macros.rs
index df28cda3..594f62e7 100644
--- a/rsvg_internals/src/property_macros.rs
+++ b/rsvg_internals/src/property_macros.rs
@@ -131,7 +131,7 @@ macro_rules! make_property {
 }
 
 macro_rules! impl_default {
-    ($name: ident, $default: expr) => {
+    ($name:ident, $default:expr) => {
         impl Default for $name {
             fn default() -> $name {
                 $default
@@ -141,7 +141,7 @@ macro_rules! impl_default {
 }
 
 macro_rules! impl_property {
-    ($name: ident, $inherits_automatically: expr) => {
+    ($name:ident, $inherits_automatically:expr) => {
         impl ::property_macros::Property for $name {
             fn inherits_automatically() -> bool {
                 $inherits_automatically
diff --git a/rsvg_internals/src/state.rs b/rsvg_internals/src/state.rs
index a63fb0e0..1f163a8e 100644
--- a/rsvg_internals/src/state.rs
+++ b/rsvg_internals/src/state.rs
@@ -15,7 +15,7 @@ use error::*;
 use iri::IRI;
 use length::{Dasharray, LengthDir, RsvgLength};
 use node::RsvgNode;
-use opacity::{Opacity, OpacitySpec, opacity_to_u8};
+use opacity::{opacity_to_u8, Opacity, OpacitySpec};
 use paint_server::PaintServer;
 use parsers::Parse;
 use property_bag::PropertyBag;
diff --git a/rsvg_internals/src/viewbox.rs b/rsvg_internals/src/viewbox.rs
index 234d8d10..5914c944 100644
--- a/rsvg_internals/src/viewbox.rs
+++ b/rsvg_internals/src/viewbox.rs
@@ -4,8 +4,8 @@ use glib_sys;
 
 use error::*;
 use parsers;
-use parsers::{ListLength, ParseError};
 use parsers::Parse;
+use parsers::{ListLength, ParseError};
 
 use self::glib::translate::*;
 


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