summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rsvg_internals/src/drawing_ctx.rs7
-rw-r--r--rsvg_internals/src/filters/color_matrix.rs7
-rw-r--r--rsvg_internals/src/node.rs10
-rw-r--r--rsvg_internals/src/pattern.rs4
-rw-r--r--rsvg_internals/src/property_bag.rs2
-rw-r--r--rsvg_internals/src/svg.rs6
6 files changed, 16 insertions, 20 deletions
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index 5a2afa43..b5d8da27 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -227,10 +227,9 @@ impl DrawingCtx {
fn size_for_temporary_surface(&self) -> (i32, i32) {
let (viewport_width, viewport_height) = (self.rect.width, self.rect.height);
- let (scaled_width, scaled_height) = self.initial_affine_with_offset().transform_distance(
- viewport_width,
- viewport_height,
- );
+ let (scaled_width, scaled_height) = self
+ .initial_affine_with_offset()
+ .transform_distance(viewport_width, viewport_height);
// We need a size in whole pixels, so use ceil() to ensure the whole viewport fits
// into the temporary surface.
diff --git a/rsvg_internals/src/filters/color_matrix.rs b/rsvg_internals/src/filters/color_matrix.rs
index de9de6f7..c6228d92 100644
--- a/rsvg_internals/src/filters/color_matrix.rs
+++ b/rsvg_internals/src/filters/color_matrix.rs
@@ -99,8 +99,7 @@ impl NodeTrait for ColorMatrix {
matrix
}
OperationType::Saturate => {
- let s = parsers::number(value)
- .attribute(attr.clone())?;
+ let s = parsers::number(value).attribute(attr.clone())?;
if s < 0.0 || s > 1.0 {
return Err(NodeError::value_error(attr, "expected value from 0 to 1"));
}
@@ -115,9 +114,7 @@ impl NodeTrait for ColorMatrix {
)
}
OperationType::HueRotate => {
- let degrees = parsers::number(value)
- .attribute(attr.clone())?;
-
+ let degrees = parsers::number(value).attribute(attr.clone())?;
let (sin, cos) = degrees.to_radians().sin_cos();
#[cfg_attr(rustfmt, rustfmt_skip)]
diff --git a/rsvg_internals/src/node.rs b/rsvg_internals/src/node.rs
index 30a64236..2184777a 100644
--- a/rsvg_internals/src/node.rs
+++ b/rsvg_internals/src/node.rs
@@ -134,12 +134,10 @@ impl NodeData {
for (attr, value) in pbag.iter() {
match attr {
local_name!("transform") => {
- return Matrix::parse_str(value)
- .attribute(attr)
- .and_then(|affine| {
- self.transform = affine;
- Ok(())
- });
+ return Matrix::parse_str(value).attribute(attr).and_then(|affine| {
+ self.transform = affine;
+ Ok(())
+ });
}
_ => (),
}
diff --git a/rsvg_internals/src/pattern.rs b/rsvg_internals/src/pattern.rs
index 5e1d3d00..941a644a 100644
--- a/rsvg_internals/src/pattern.rs
+++ b/rsvg_internals/src/pattern.rs
@@ -58,9 +58,7 @@ impl NodeTrait for NodePattern {
for (attr, value) in pbag.iter() {
match attr {
local_name!("patternUnits") => self.units = Some(attr.parse(value)?),
- local_name!("patternContentUnits") => {
- self.content_units = Some(attr.parse(value)?)
- }
+ local_name!("patternContentUnits") => self.content_units = Some(attr.parse(value)?),
local_name!("viewBox") => self.vbox = Some(Some(attr.parse(value)?)),
local_name!("preserveAspectRatio") => {
self.preserve_aspect_ratio = Some(attr.parse(value)?)
diff --git a/rsvg_internals/src/property_bag.rs b/rsvg_internals/src/property_bag.rs
index c0713b59..5bf1940a 100644
--- a/rsvg_internals/src/property_bag.rs
+++ b/rsvg_internals/src/property_bag.rs
@@ -89,8 +89,8 @@ impl<'a> Iterator for PropertyBagIter<'a> {
#[cfg(test)]
mod tests {
- use markup5ever::local_name;
use super::*;
+ use markup5ever::local_name;
use std::ffi::CString;
use std::ptr;
diff --git a/rsvg_internals/src/svg.rs b/rsvg_internals/src/svg.rs
index 7aabdd32..ffceb0fc 100644
--- a/rsvg_internals/src/svg.rs
+++ b/rsvg_internals/src/svg.rs
@@ -36,7 +36,11 @@ pub struct Svg {
}
impl Svg {
- pub fn new(mut tree: RsvgNode, ids: HashMap<String, RsvgNode>, load_options: LoadOptions) -> Svg {
+ pub fn new(
+ mut tree: RsvgNode,
+ ids: HashMap<String, RsvgNode>,
+ load_options: LoadOptions,
+ ) -> Svg {
let values = ComputedValues::default();
tree.cascade(&values);