[librsvg] cargo fmt



commit 8b002eb3260d6fe53b5d9a7feb864401e244becf
Author: Paolo Borelli <pborelli gnome org>
Date:   Mon Jan 6 12:58:18 2020 +0100

    cargo fmt

 librsvg_crate/examples/proportional.rs             | 19 ++++++++--------
 librsvg_crate/tests/api.rs                         | 15 +++++--------
 librsvg_crate/tests/intrinsic_dimensions.rs        |  7 +-----
 librsvg_crate/tests/primitives.rs                  | 12 ++---------
 librsvg_crate/tests/utils/compare_surfaces.rs      |  3 +--
 librsvg_crate/tests/utils/mod.rs                   |  4 +++-
 rsvg_internals/benches/box_blur.rs                 |  7 +-----
 rsvg_internals/benches/lighting.rs                 | 11 ++--------
 rsvg_internals/benches/srgb.rs                     |  3 +--
 rsvg_internals/src/create_node.rs                  |  7 ++----
 rsvg_internals/src/filters/color_matrix.rs         |  5 +----
 rsvg_internals/src/filters/component_transfer.rs   |  5 +----
 rsvg_internals/src/filters/convolve_matrix.rs      |  4 +---
 rsvg_internals/src/filters/light/lighting.rs       | 25 ++++++----------------
 rsvg_internals/src/filters/morphology.rs           |  4 +---
 rsvg_internals/src/filters/turbulence.rs           |  3 +--
 rsvg_internals/src/io.rs                           | 12 ++---------
 rsvg_internals/src/lib.rs                          |  7 +-----
 rsvg_internals/src/properties.rs                   |  8 +------
 rsvg_internals/src/srgb.rs                         |  3 +--
 rsvg_internals/src/surface_utils/shared_surface.rs |  2 +-
 rsvg_internals/src/text.rs                         | 12 ++---------
 22 files changed, 46 insertions(+), 132 deletions(-)
---
diff --git a/librsvg_crate/examples/proportional.rs b/librsvg_crate/examples/proportional.rs
index 6bb474e9..ba3e7932 100644
--- a/librsvg_crate/examples/proportional.rs
+++ b/librsvg_crate/examples/proportional.rs
@@ -42,16 +42,15 @@ fn main() {
     let surface = cairo::ImageSurface::create(cairo::Format::ARgb32, width, height).unwrap();
     let cr = cairo::Context::new(&surface);
 
-    let res = renderer
-        .render_document(
-            &cr,
-            &cairo::Rectangle {
-                x: 0.0,
-                y: 0.0,
-                width: f64::from(width),
-                height: f64::from(height),
-            },
-        );
+    let res = renderer.render_document(
+        &cr,
+        &cairo::Rectangle {
+            x: 0.0,
+            y: 0.0,
+            width: f64::from(width),
+            height: f64::from(height),
+        },
+    );
 
     match res {
         Ok(()) => {
diff --git a/librsvg_crate/tests/api.rs b/librsvg_crate/tests/api.rs
index 9775e4e2..b993003c 100644
--- a/librsvg_crate/tests/api.rs
+++ b/librsvg_crate/tests/api.rs
@@ -111,9 +111,7 @@ fn untransformed_element() {
 
     /* Measuring */
 
-    let (ink_r, logical_r) = renderer
-        .geometry_for_element(Some("#foo"))
-        .unwrap();
+    let (ink_r, logical_r) = renderer.geometry_for_element(Some("#foo")).unwrap();
 
     assert_eq!(
         ink_r,
@@ -151,8 +149,9 @@ fn untransformed_element() {
         renderer.render_element(&cr, Some("#foo"), &viewport)
     };
 
-    let output_surf =
-        res.and_then(|_| Ok(SharedImageSurface::new(output, SurfaceType::SRgb).unwrap())).unwrap();
+    let output_surf = res
+        .and_then(|_| Ok(SharedImageSurface::new(output, SurfaceType::SRgb).unwrap()))
+        .unwrap();
 
     let reference_surf = cairo::ImageSurface::create(cairo::Format::ARgb32, 300, 300).unwrap();
 
@@ -172,9 +171,5 @@ fn untransformed_element() {
 
     let reference_surf = SharedImageSurface::new(reference_surf, SurfaceType::SRgb).unwrap();
 
-    compare_to_surface(
-        &output_surf,
-        &reference_surf,
-        "untransformed_element",
-    );
+    compare_to_surface(&output_surf, &reference_surf, "untransformed_element");
 }
diff --git a/librsvg_crate/tests/intrinsic_dimensions.rs b/librsvg_crate/tests/intrinsic_dimensions.rs
index 5015e31e..5eaea94a 100644
--- a/librsvg_crate/tests/intrinsic_dimensions.rs
+++ b/librsvg_crate/tests/intrinsic_dimensions.rs
@@ -1,12 +1,7 @@
 use cairo;
 
 use librsvg::{
-    CairoRenderer,
-    DefsLookupErrorKind,
-    HrefError,
-    IntrinsicDimensions,
-    Length,
-    LengthUnit,
+    CairoRenderer, DefsLookupErrorKind, HrefError, IntrinsicDimensions, Length, LengthUnit,
     RenderingError,
 };
 
diff --git a/librsvg_crate/tests/primitives.rs b/librsvg_crate/tests/primitives.rs
index 4ff262e4..e1ab8e4b 100644
--- a/librsvg_crate/tests/primitives.rs
+++ b/librsvg_crate/tests/primitives.rs
@@ -139,11 +139,7 @@ fn simple_opacity_with_scale() {
 
     let reference_surf = SharedImageSurface::new(reference_surf, SurfaceType::SRgb).unwrap();
 
-    compare_to_surface(
-        &output_surf,
-        &reference_surf,
-        "simple_opacity_with_scale",
-    );
+    compare_to_surface(&output_surf, &reference_surf, "simple_opacity_with_scale");
 }
 
 #[test]
@@ -201,11 +197,7 @@ fn markers_with_scale() {
 
     let reference_surf = SharedImageSurface::new(reference_surf, SurfaceType::SRgb).unwrap();
 
-    compare_to_surface(
-        &output_surf,
-        &reference_surf,
-        "markers_with_scale",
-    );
+    compare_to_surface(&output_surf, &reference_surf, "markers_with_scale");
 }
 
 #[test]
diff --git a/librsvg_crate/tests/utils/compare_surfaces.rs b/librsvg_crate/tests/utils/compare_surfaces.rs
index 78bb3415..b75c4b0e 100644
--- a/librsvg_crate/tests/utils/compare_surfaces.rs
+++ b/librsvg_crate/tests/utils/compare_surfaces.rs
@@ -6,8 +6,7 @@ use cairo::ImageSurface;
 use self::rsvg_internals::surface_utils::{
     iterators::Pixels,
     shared_surface::{SharedImageSurface, SurfaceType},
-    ImageSurfaceDataExt,
-    Pixel,
+    ImageSurfaceDataExt, Pixel,
 };
 use self::rsvg_internals::{IRect, RenderingError};
 
diff --git a/librsvg_crate/tests/utils/mod.rs b/librsvg_crate/tests/utils/mod.rs
index c76d1223..8b67ce29 100644
--- a/librsvg_crate/tests/utils/mod.rs
+++ b/librsvg_crate/tests/utils/mod.rs
@@ -23,7 +23,9 @@ pub fn load_svg(input: &'static [u8]) -> SvgHandle {
     let bytes = glib::Bytes::from_static(input);
     let stream = gio::MemoryInputStream::new_from_bytes(&bytes);
 
-    Loader::new().read_stream(&stream, None::<&gio::File>, None::<&gio::Cancellable>).unwrap()
+    Loader::new()
+        .read_stream(&stream, None::<&gio::File>, None::<&gio::Cancellable>)
+        .unwrap()
 }
 
 #[derive(Copy, Clone)]
diff --git a/rsvg_internals/benches/box_blur.rs b/rsvg_internals/benches/box_blur.rs
index eddc03fa..804b9729 100644
--- a/rsvg_internals/benches/box_blur.rs
+++ b/rsvg_internals/benches/box_blur.rs
@@ -4,12 +4,7 @@ use criterion::Criterion;
 
 use rsvg_internals::rect::IRect;
 use rsvg_internals::surface_utils::shared_surface::{
-    AlphaOnly,
-    Horizontal,
-    NotAlphaOnly,
-    SharedImageSurface,
-    SurfaceType,
-    Vertical,
+    AlphaOnly, Horizontal, NotAlphaOnly, SharedImageSurface, SurfaceType, Vertical,
 };
 
 const SURFACE_SIDE: i32 = 512;
diff --git a/rsvg_internals/benches/lighting.rs b/rsvg_internals/benches/lighting.rs
index 0acf4fa3..8a485c2a 100644
--- a/rsvg_internals/benches/lighting.rs
+++ b/rsvg_internals/benches/lighting.rs
@@ -4,15 +4,8 @@ use criterion::Criterion;
 use nalgebra::{Matrix3, Vector2};
 
 use rsvg_internals::filters::light::{
-    bottom_left_normal,
-    bottom_right_normal,
-    bottom_row_normal,
-    interior_normal,
-    left_column_normal,
-    right_column_normal,
-    top_left_normal,
-    top_right_normal,
-    top_row_normal,
+    bottom_left_normal, bottom_right_normal, bottom_row_normal, interior_normal,
+    left_column_normal, right_column_normal, top_left_normal, top_right_normal, top_row_normal,
     Normal,
 };
 use rsvg_internals::rect::IRect;
diff --git a/rsvg_internals/benches/srgb.rs b/rsvg_internals/benches/srgb.rs
index 326888c0..55363de0 100644
--- a/rsvg_internals/benches/srgb.rs
+++ b/rsvg_internals/benches/srgb.rs
@@ -6,8 +6,7 @@ use rsvg_internals::rect::IRect;
 use rsvg_internals::srgb::{linearize, map_unpremultiplied_components_loop};
 use rsvg_internals::surface_utils::{
     shared_surface::{SharedImageSurface, SurfaceType},
-    ImageSurfaceDataExt,
-    Pixel,
+    ImageSurfaceDataExt, Pixel,
 };
 
 const SURFACE_SIDE: i32 = 512;
diff --git a/rsvg_internals/src/create_node.rs b/rsvg_internals/src/create_node.rs
index 0d1501ae..6000fe84 100644
--- a/rsvg_internals/src/create_node.rs
+++ b/rsvg_internals/src/create_node.rs
@@ -21,11 +21,8 @@ use crate::filters::{
     gaussian_blur::FeGaussianBlur,
     image::FeImage,
     light::{
-        light_source::FeDistantLight,
-        light_source::FePointLight,
-        light_source::FeSpotLight,
-        lighting::FeDiffuseLighting,
-        lighting::FeSpecularLighting,
+        light_source::FeDistantLight, light_source::FePointLight, light_source::FeSpotLight,
+        lighting::FeDiffuseLighting, lighting::FeSpecularLighting,
     },
     merge::{FeMerge, FeMergeNode},
     morphology::FeMorphology,
diff --git a/rsvg_internals/src/filters/color_matrix.rs b/rsvg_internals/src/filters/color_matrix.rs
index c029e4c1..71bc6cd1 100644
--- a/rsvg_internals/src/filters/color_matrix.rs
+++ b/rsvg_internals/src/filters/color_matrix.rs
@@ -9,10 +9,7 @@ use crate::number_list::{NumberList, NumberListLength};
 use crate::parsers::{Parse, ParseValue};
 use crate::property_bag::PropertyBag;
 use crate::surface_utils::{
-    iterators::Pixels,
-    shared_surface::SharedImageSurface,
-    ImageSurfaceDataExt,
-    Pixel,
+    iterators::Pixels, shared_surface::SharedImageSurface, ImageSurfaceDataExt, Pixel,
 };
 use crate::util::clamp;
 
diff --git a/rsvg_internals/src/filters/component_transfer.rs 
b/rsvg_internals/src/filters/component_transfer.rs
index 82a88591..67c124e4 100644
--- a/rsvg_internals/src/filters/component_transfer.rs
+++ b/rsvg_internals/src/filters/component_transfer.rs
@@ -10,10 +10,7 @@ use crate::number_list::{NumberList, NumberListLength};
 use crate::parsers::{Parse, ParseValue};
 use crate::property_bag::PropertyBag;
 use crate::surface_utils::{
-    iterators::Pixels,
-    shared_surface::SharedImageSurface,
-    ImageSurfaceDataExt,
-    Pixel,
+    iterators::Pixels, shared_surface::SharedImageSurface, ImageSurfaceDataExt, Pixel,
 };
 use crate::util::clamp;
 
diff --git a/rsvg_internals/src/filters/convolve_matrix.rs b/rsvg_internals/src/filters/convolve_matrix.rs
index dff07ec0..ad3cda2b 100644
--- a/rsvg_internals/src/filters/convolve_matrix.rs
+++ b/rsvg_internals/src/filters/convolve_matrix.rs
@@ -12,9 +12,7 @@ use crate::rect::IRect;
 use crate::surface_utils::{
     iterators::{PixelRectangle, Pixels},
     shared_surface::SharedImageSurface,
-    EdgeMode,
-    ImageSurfaceDataExt,
-    Pixel,
+    EdgeMode, ImageSurfaceDataExt, Pixel,
 };
 use crate::util::clamp;
 
diff --git a/rsvg_internals/src/filters/light/lighting.rs b/rsvg_internals/src/filters/light/lighting.rs
index 82c225c6..ffe6281d 100644
--- a/rsvg_internals/src/filters/light/lighting.rs
+++ b/rsvg_internals/src/filters/light/lighting.rs
@@ -10,32 +10,19 @@ use crate::error::*;
 use crate::filters::{
     context::{FilterContext, FilterOutput, FilterResult},
     light::{
-        bottom_left_normal,
-        bottom_right_normal,
-        bottom_row_normal,
-        interior_normal,
-        left_column_normal,
-        light_source::FeDistantLight,
-        light_source::FePointLight,
-        light_source::FeSpotLight,
-        light_source::LightSource,
-        right_column_normal,
-        top_left_normal,
-        top_right_normal,
-        top_row_normal,
-        Normal,
+        bottom_left_normal, bottom_right_normal, bottom_row_normal, interior_normal,
+        left_column_normal, light_source::FeDistantLight, light_source::FePointLight,
+        light_source::FeSpotLight, light_source::LightSource, right_column_normal, top_left_normal,
+        top_right_normal, top_row_normal, Normal,
     },
-    FilterEffect,
-    FilterError,
-    PrimitiveWithInput,
+    FilterEffect, FilterError, PrimitiveWithInput,
 };
 use crate::node::{CascadedValues, NodeResult, NodeTrait, NodeType, RsvgNode};
 use crate::parsers::{NumberOptionalNumber, ParseValue};
 use crate::property_bag::PropertyBag;
 use crate::surface_utils::{
     shared_surface::{SharedImageSurface, SurfaceType},
-    ImageSurfaceDataExt,
-    Pixel,
+    ImageSurfaceDataExt, Pixel,
 };
 use crate::util::clamp;
 
diff --git a/rsvg_internals/src/filters/morphology.rs b/rsvg_internals/src/filters/morphology.rs
index 3fbebbb9..083025c8 100644
--- a/rsvg_internals/src/filters/morphology.rs
+++ b/rsvg_internals/src/filters/morphology.rs
@@ -12,9 +12,7 @@ use crate::rect::IRect;
 use crate::surface_utils::{
     iterators::{PixelRectangle, Pixels},
     shared_surface::SharedImageSurface,
-    EdgeMode,
-    ImageSurfaceDataExt,
-    Pixel,
+    EdgeMode, ImageSurfaceDataExt, Pixel,
 };
 
 use super::context::{FilterContext, FilterOutput, FilterResult};
diff --git a/rsvg_internals/src/filters/turbulence.rs b/rsvg_internals/src/filters/turbulence.rs
index 22951ea4..17f99df7 100644
--- a/rsvg_internals/src/filters/turbulence.rs
+++ b/rsvg_internals/src/filters/turbulence.rs
@@ -8,8 +8,7 @@ use crate::parsers::{NumberOptionalNumber, Parse, ParseValue};
 use crate::property_bag::PropertyBag;
 use crate::surface_utils::{
     shared_surface::{SharedImageSurface, SurfaceType},
-    ImageSurfaceDataExt,
-    Pixel,
+    ImageSurfaceDataExt, Pixel,
 };
 use crate::util::clamp;
 
diff --git a/rsvg_internals/src/io.rs b/rsvg_internals/src/io.rs
index c823db58..70ab0853 100644
--- a/rsvg_internals/src/io.rs
+++ b/rsvg_internals/src/io.rs
@@ -3,16 +3,8 @@
 use data_url;
 
 use gio::{
-    BufferedInputStream,
-    BufferedInputStreamExt,
-    Cancellable,
-    ConverterInputStream,
-    File as GFile,
-    FileExt,
-    InputStream,
-    MemoryInputStream,
-    ZlibCompressorFormat,
-    ZlibDecompressor,
+    BufferedInputStream, BufferedInputStreamExt, Cancellable, ConverterInputStream, File as GFile,
+    FileExt, InputStream, MemoryInputStream, ZlibCompressorFormat, ZlibDecompressor,
 };
 use glib::{Bytes as GBytes, Cast};
 
diff --git a/rsvg_internals/src/lib.rs b/rsvg_internals/src/lib.rs
index eb1760a9..35f3bd3e 100644
--- a/rsvg_internals/src/lib.rs
+++ b/rsvg_internals/src/lib.rs
@@ -47,12 +47,7 @@ pub use crate::dpi::{rsvg_rust_set_default_dpi_x_y, Dpi};
 pub use crate::error::{DefsLookupErrorKind, HrefError, LoadingError, RenderingError};
 
 pub use crate::handle::{
-    Handle,
-    LoadOptions,
-    RsvgDimensionData,
-    RsvgPositionData,
-    RsvgSizeFunc,
-    SizeCallback,
+    Handle, LoadOptions, RsvgDimensionData, RsvgPositionData, RsvgSizeFunc, SizeCallback,
 };
 
 pub use crate::length::{Length, LengthUnit, RsvgLength};
diff --git a/rsvg_internals/src/properties.rs b/rsvg_internals/src/properties.rs
index a14a794c..9fdcd471 100644
--- a/rsvg_internals/src/properties.rs
+++ b/rsvg_internals/src/properties.rs
@@ -1,13 +1,7 @@
 //! CSS properties, specified values, computed values.
 
 use cssparser::{
-    self,
-    BasicParseErrorKind,
-    DeclarationListParser,
-    ParseErrorKind,
-    Parser,
-    ParserInput,
-    ToCss,
+    self, BasicParseErrorKind, DeclarationListParser, ParseErrorKind, Parser, ParserInput, ToCss,
 };
 use markup5ever::{expanded_name, local_name, namespace_url, ns, QualName};
 use std::collections::HashSet;
diff --git a/rsvg_internals/src/srgb.rs b/rsvg_internals/src/srgb.rs
index 8d843aae..6c96d329 100644
--- a/rsvg_internals/src/srgb.rs
+++ b/rsvg_internals/src/srgb.rs
@@ -6,8 +6,7 @@ use crate::rect::IRect;
 use crate::surface_utils::{
     iterators::Pixels,
     shared_surface::{SharedImageSurface, SurfaceType},
-    ImageSurfaceDataExt,
-    Pixel,
+    ImageSurfaceDataExt, Pixel,
 };
 
 // Include the linearization and unlinearization tables.
diff --git a/rsvg_internals/src/surface_utils/shared_surface.rs 
b/rsvg_internals/src/surface_utils/shared_surface.rs
index 4454109d..31c126a8 100644
--- a/rsvg_internals/src/surface_utils/shared_surface.rs
+++ b/rsvg_internals/src/surface_utils/shared_surface.rs
@@ -938,7 +938,7 @@ impl SharedImageSurface {
         &self,
         bounds: IRect,
         dx: f64,
-        dy: f64
+        dy: f64,
     ) -> Result<SharedImageSurface, cairo::Status> {
         let output_surface =
             cairo::ImageSurface::create(cairo::Format::ARgb32, self.width, self.height)?;
diff --git a/rsvg_internals/src/text.rs b/rsvg_internals/src/text.rs
index bf2295c4..ce3bb5b6 100644
--- a/rsvg_internals/src/text.rs
+++ b/rsvg_internals/src/text.rs
@@ -17,16 +17,8 @@ use crate::parsers::ParseValue;
 use crate::properties::ComputedValues;
 use crate::property_bag::PropertyBag;
 use crate::property_defs::{
-    Direction,
-    FontStretch,
-    FontStyle,
-    FontVariant,
-    TextAnchor,
-    TextRendering,
-    UnicodeBidi,
-    WritingMode,
-    XmlLang,
-    XmlSpace,
+    Direction, FontStretch, FontStyle, FontVariant, TextAnchor, TextRendering, UnicodeBidi,
+    WritingMode, XmlLang, XmlSpace,
 };
 use crate::rect::Rect;
 use crate::space::{xml_space_normalize, NormalizeDefault, XmlSpaceNormalize};


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