[librsvg/librsvg-2.44] rustfmt



commit 1923d087a1faef1ca2bd80e31d9ddca113189d5d
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Oct 23 19:20:26 2018 -0500

    rustfmt

 rsvg_internals/src/length.rs | 16 +++++-------
 rsvg_internals/src/marker.rs | 60 +++++++++++++++++++++-----------------------
 rsvg_internals/src/text.rs   |  9 ++++---
 3 files changed, 39 insertions(+), 46 deletions(-)
---
diff --git a/rsvg_internals/src/length.rs b/rsvg_internals/src/length.rs
index 1d4257b8..d9caaf2d 100644
--- a/rsvg_internals/src/length.rs
+++ b/rsvg_internals/src/length.rs
@@ -398,16 +398,12 @@ mod tests {
 
     #[test]
     fn check_nonnegative_works() {
-        assert!(
-            Length::parse_str("0", LengthDir::Both)
-                .and_then(|l| l.check_nonnegative())
-                .is_ok()
-        );
-        assert!(
-            Length::parse_str("-10", LengthDir::Both)
-                .and_then(|l| l.check_nonnegative())
-                .is_err()
-        );
+        assert!(Length::parse_str("0", LengthDir::Both)
+            .and_then(|l| l.check_nonnegative())
+            .is_ok());
+        assert!(Length::parse_str("-10", LengthDir::Both)
+            .and_then(|l| l.check_nonnegative())
+            .is_err());
     }
 
     #[test]
diff --git a/rsvg_internals/src/marker.rs b/rsvg_internals/src/marker.rs
index d9f80c01..442617a9 100644
--- a/rsvg_internals/src/marker.rs
+++ b/rsvg_internals/src/marker.rs
@@ -1233,10 +1233,10 @@ mod directionality_tests {
 
     #[test]
     fn curve_with_coincident_control_points_has_no_directionality() {
-        assert!(
-            super::get_segment_directionalities(&curve(1.0, 2.0, 1.0, 2.0, 1.0, 2.0, 1.0, 2.0))
-                .is_none()
-        );
+        assert!(super::get_segment_directionalities(&curve(
+            1.0, 2.0, 1.0, 2.0, 1.0, 2.0, 1.0, 2.0
+        ))
+        .is_none());
     }
 
     #[test]
@@ -1284,20 +1284,18 @@ mod marker_tests {
 
         let mut v = Vec::new();
 
-        assert!(
-            emit_markers_for_path_builder(
-                &builder,
-                &mut |marker_type: MarkerType,
-                      x: f64,
-                      y: f64,
-                      computed_angle: f64|
-                 -> Result<(), RenderingError> {
-                    v.push((marker_type, x, y, computed_angle));
-                    Ok(())
-                }
-            )
-            .is_ok()
-        );
+        assert!(emit_markers_for_path_builder(
+            &builder,
+            &mut |marker_type: MarkerType,
+                  x: f64,
+                  y: f64,
+                  computed_angle: f64|
+             -> Result<(), RenderingError> {
+                v.push((marker_type, x, y, computed_angle));
+                Ok(())
+            }
+        )
+        .is_ok());
 
         assert_eq!(
             v,
@@ -1321,20 +1319,18 @@ mod marker_tests {
 
         let mut v = Vec::new();
 
-        assert!(
-            emit_markers_for_path_builder(
-                &builder,
-                &mut |marker_type: MarkerType,
-                      x: f64,
-                      y: f64,
-                      computed_angle: f64|
-                 -> Result<(), RenderingError> {
-                    v.push((marker_type, x, y, computed_angle));
-                    Ok(())
-                }
-            )
-            .is_ok()
-        );
+        assert!(emit_markers_for_path_builder(
+            &builder,
+            &mut |marker_type: MarkerType,
+                  x: f64,
+                  y: f64,
+                  computed_angle: f64|
+             -> Result<(), RenderingError> {
+                v.push((marker_type, x, y, computed_angle));
+                Ok(())
+            }
+        )
+        .is_ok());
 
         assert_eq!(
             v,
diff --git a/rsvg_internals/src/text.rs b/rsvg_internals/src/text.rs
index c3d05f97..c92756fd 100644
--- a/rsvg_internals/src/text.rs
+++ b/rsvg_internals/src/text.rs
@@ -91,10 +91,11 @@ impl NodeChars {
         let (width, _) = layout.get_size();
 
         let baseline = f64::from(layout.get_baseline()) / f64::from(pango::SCALE);
-        let offset = baseline + values
-            .baseline_shift
-            .0
-            .normalize(values, &draw_ctx.get_view_params());
+        let offset = baseline
+            + values
+                .baseline_shift
+                .0
+                .normalize(values, &draw_ctx.get_view_params());
 
         if values.text_gravity_is_vertical() {
             draw_ctx.draw_pango_layout(&layout, values, *x + offset, *y, clipping)?;


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