Fix clippy lints

Emmanuel Gil Peyrot created

Change summary

src/convert.rs       | 2 +-
src/element.rs       | 4 ++--
src/namespace_set.rs | 6 +++---
src/node.rs          | 4 +---
4 files changed, 7 insertions(+), 9 deletions(-)

Detailed changes

src/convert.rs 🔗

@@ -44,7 +44,7 @@ impl<'a> IntoAttributeValue for &'a str {
 
 impl<T: IntoAttributeValue> IntoAttributeValue for Option<T> {
     fn into_attribute_value(self) -> Option<String> {
-        self.and_then(|t| t.into_attribute_value())
+        self.and_then(IntoAttributeValue::into_attribute_value)
     }
 }
 

src/element.rs 🔗

@@ -102,8 +102,8 @@ impl Element {
         Element {
             prefix, name,
             namespaces: Rc::new(namespaces.into()),
-            attributes: attributes,
-            children: children,
+            attributes,
+            children,
         }
     }
 

src/namespace_set.rs 🔗

@@ -58,7 +58,7 @@ impl From<BTreeMap<Option<String>, String>> for NamespaceSet {
     fn from(namespaces: BTreeMap<Option<String>, String>) -> Self {
         NamespaceSet {
             parent: RefCell::new(None),
-            namespaces: namespaces,
+            namespaces,
         }
     }
 }
@@ -79,7 +79,7 @@ impl From<String> for NamespaceSet {
 
         NamespaceSet {
             parent: RefCell::new(None),
-            namespaces: namespaces,
+            namespaces,
         }
     }
 }
@@ -92,7 +92,7 @@ impl From<(Option<String>, String)> for NamespaceSet {
 
         NamespaceSet {
             parent: RefCell::new(None),
-            namespaces: namespaces,
+            namespaces,
         }
     }
 }

src/node.rs 🔗

@@ -165,13 +165,11 @@ impl Node {
             Node::Element(ref elmt) => elmt.write_to_inner(writer)?,
             Node::Text(ref s) => {
                 writer.write_event(Event::Text(BytesText::from_plain_str(s)))?;
-                ()
             },
             Node::Comment(ref s) => {
                 writer.write_event(Event::Comment(BytesText::from_plain_str(s)))?;
-                ()
             },
-        };
+        }
 
         Ok(())
     }