diff options
author | Jordan Petridis <jordanpetridis@protonmail.com> | 2018-05-31 09:41:31 +0300 |
---|---|---|
committer | Jordan Petridis <jordanpetridis@protonmail.com> | 2018-05-31 09:41:31 +0300 |
commit | b709f9a7dec468e66605ec26cd7673b3cc35c2c9 (patch) | |
tree | 33adf46d82f93df7dd427e2bdbeec9374959296c | |
parent | 3982896528fe44d0b0bc8ad859d1dfc55ad3a1fd (diff) | |
download | librsvg-alatiera/rustfmt.tar.gz |
cargo fmtalatiera/rustfmt
-rw-r--r-- | .rustfmt.toml | 1 | ||||
-rw-r--r-- | rsvg_internals/src/property_macros.rs | 2 | ||||
-rw-r--r-- | rsvg_internals/src/shapes.rs | 28 | ||||
-rw-r--r-- | rsvg_internals/src/structure.rs | 28 | ||||
-rw-r--r-- | rsvg_internals/src/unitinterval.rs | 8 |
5 files changed, 38 insertions, 29 deletions
diff --git a/.rustfmt.toml b/.rustfmt.toml index 9d6f9fdd..1dabca43 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -6,7 +6,6 @@ wrap_comments = true tab_spaces = 4 hard_tabs = false newline_style = "Unix" -write_mode = "Overwrite" condense_wildcard_suffixes = false format_strings = true normalize_comments = true diff --git a/rsvg_internals/src/property_macros.rs b/rsvg_internals/src/property_macros.rs index 5054c9e2..cc08fffc 100644 --- a/rsvg_internals/src/property_macros.rs +++ b/rsvg_internals/src/property_macros.rs @@ -14,7 +14,7 @@ pub trait Property<T> { /// make_property!( /// StrokeLinejoin, /// default: Miter, -/// +/// /// "miter" => Miter, /// "round" => Round, /// "bevel" => Bevel, diff --git a/rsvg_internals/src/shapes.rs b/rsvg_internals/src/shapes.rs index a16aee53..5979f5f5 100644 --- a/rsvg_internals/src/shapes.rs +++ b/rsvg_internals/src/shapes.rs @@ -323,18 +323,22 @@ impl NodeTrait for NodeRect { Some(RsvgLength::check_nonnegative), )?), - Attribute::Rx => self.rx.set(parse( - "rx", - value, - LengthDir::Horizontal, - Some(RsvgLength::check_nonnegative), - ).map(Some)?), - Attribute::Ry => self.ry.set(parse( - "ry", - value, - LengthDir::Vertical, - Some(RsvgLength::check_nonnegative), - ).map(Some)?), + Attribute::Rx => self.rx.set( + parse( + "rx", + value, + LengthDir::Horizontal, + Some(RsvgLength::check_nonnegative), + ).map(Some)?, + ), + Attribute::Ry => self.ry.set( + parse( + "ry", + value, + LengthDir::Vertical, + Some(RsvgLength::check_nonnegative), + ).map(Some)?, + ), _ => (), } diff --git a/rsvg_internals/src/structure.rs b/rsvg_internals/src/structure.rs index f34960eb..d6fd4963 100644 --- a/rsvg_internals/src/structure.rs +++ b/rsvg_internals/src/structure.rs @@ -247,18 +247,22 @@ impl NodeTrait for NodeUse { Attribute::X => self.x.set(parse("x", value, LengthDir::Horizontal, None)?), Attribute::Y => self.y.set(parse("y", value, LengthDir::Vertical, None)?), - Attribute::Width => self.w.set(parse( - "width", - value, - LengthDir::Horizontal, - Some(RsvgLength::check_nonnegative), - ).map(Some)?), - Attribute::Height => self.h.set(parse( - "height", - value, - LengthDir::Vertical, - Some(RsvgLength::check_nonnegative), - ).map(Some)?), + Attribute::Width => self.w.set( + parse( + "width", + value, + LengthDir::Horizontal, + Some(RsvgLength::check_nonnegative), + ).map(Some)?, + ), + Attribute::Height => self.h.set( + parse( + "height", + value, + LengthDir::Vertical, + Some(RsvgLength::check_nonnegative), + ).map(Some)?, + ), _ => (), } diff --git a/rsvg_internals/src/unitinterval.rs b/rsvg_internals/src/unitinterval.rs index 24594b9b..022cf170 100644 --- a/rsvg_internals/src/unitinterval.rs +++ b/rsvg_internals/src/unitinterval.rs @@ -20,9 +20,11 @@ impl FromStr for UnitInterval { let mut input = cssparser::ParserInput::new(s); let mut parser = cssparser::Parser::new(&mut input); - let x = f64::from(parser - .expect_number() - .map_err(|_| AttributeError::Parse(ParseError::new("expected number")))?); + let x = f64::from( + parser + .expect_number() + .map_err(|_| AttributeError::Parse(ParseError::new("expected number")))?, + ); let cx = if x < 0.0 { 0.0 |