[librsvg: 5/6] cargo fmt
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 5/6] cargo fmt
- Date: Tue, 2 Mar 2021 01:12:20 +0000 (UTC)
commit 23c7ed0c6753e27b90a3c093fa7ae243719c7f2d
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Mar 1 18:57:54 2021 -0600
cargo fmt
src/element.rs | 14 +++++++-------
src/filters/lighting.rs | 6 +++++-
src/gradient.rs | 7 ++++---
src/iri.rs | 10 ++++++++--
4 files changed, 24 insertions(+), 13 deletions(-)
---
diff --git a/src/element.rs b/src/element.rs
index 7f6569eb..60f908e2 100644
--- a/src/element.rs
+++ b/src/element.rs
@@ -590,13 +590,13 @@ impl Element {
pub fn is_accessed_by_reference(&self) -> bool {
matches!(
self,
- Element::ClipPath(_) |
- Element::Filter(_) |
- Element::LinearGradient(_) |
- Element::Marker(_) |
- Element::Mask(_) |
- Element::Pattern(_) |
- Element::RadialGradient(_)
+ Element::ClipPath(_)
+ | Element::Filter(_)
+ | Element::LinearGradient(_)
+ | Element::Marker(_)
+ | Element::Mask(_)
+ | Element::Pattern(_)
+ | Element::RadialGradient(_)
)
}
}
diff --git a/src/filters/lighting.rs b/src/filters/lighting.rs
index 8ec4b6fd..a7ccbf59 100644
--- a/src/filters/lighting.rs
+++ b/src/filters/lighting.rs
@@ -52,7 +52,11 @@ struct Light {
impl Light {
pub fn new(node: &Node, paffine: Transform) -> Result<Light, FilterError> {
let mut sources = node.children().rev().filter(|c| {
- c.is_element() && matches!(*c.borrow_element(), Element::FeDistantLight(_) |
Element::FePointLight(_) | Element::FeSpotLight(_))
+ c.is_element()
+ && matches!(
+ *c.borrow_element(),
+ Element::FeDistantLight(_) | Element::FePointLight(_) | Element::FeSpotLight(_)
+ )
});
let source_node = sources.next();
diff --git a/src/gradient.rs b/src/gradient.rs
index 68bf8388..31a3bc11 100644
--- a/src/gradient.rs
+++ b/src/gradient.rs
@@ -442,9 +442,10 @@ impl UnresolvedGradient {
/// Looks for <stop> children inside a linearGradient or radialGradient node,
/// and adds their info to the UnresolvedGradient &self.
fn add_color_stops_from_node(&mut self, node: &Node) {
- assert!(
- matches!(*node.borrow_element(), Element::LinearGradient(_) | Element::RadialGradient(_))
- );
+ assert!(matches!(
+ *node.borrow_element(),
+ Element::LinearGradient(_) | Element::RadialGradient(_)
+ ));
for child in node.children().filter(|c| c.is_element()) {
let elt = child.borrow_element();
diff --git a/src/iri.rs b/src/iri.rs
index 60ba3362..1a984c46 100644
--- a/src/iri.rs
+++ b/src/iri.rs
@@ -70,7 +70,10 @@ mod tests {
assert_eq!(
IRI::parse_str("url(foo#bar)").unwrap(),
- IRI::Resource(Box::new(NodeId::External("foo".to_string(), "bar".to_string())))
+ IRI::Resource(Box::new(NodeId::External(
+ "foo".to_string(),
+ "bar".to_string()
+ )))
);
// be permissive if the closing ) is missing
@@ -80,7 +83,10 @@ mod tests {
);
assert_eq!(
IRI::parse_str("url(foo#bar").unwrap(),
- IRI::Resource(Box::new(NodeId::External("foo".to_string(), "bar".to_string())))
+ IRI::Resource(Box::new(NodeId::External(
+ "foo".to_string(),
+ "bar".to_string()
+ )))
);
assert!(IRI::parse_str("").is_err());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]