xso-proc: Fix all clippy warnings

Emmanuel Gil Peyrot created

Change summary

xso-proc/src/compound.rs      | 4 ++--
xso-proc/src/error_message.rs | 2 +-
xso-proc/src/field.rs         | 5 +----
xso-proc/src/meta.rs          | 4 ++--
xso-proc/src/structs.rs       | 4 ++--
5 files changed, 8 insertions(+), 11 deletions(-)

Detailed changes

xso-proc/src/compound.rs 🔗

@@ -97,7 +97,7 @@ impl Compound {
         for field in self.fields.iter() {
             let member = field.member();
             let builder_field_name = mangle_member(member);
-            let part = field.make_builder_part(&scope, &output_name)?;
+            let part = field.make_builder_part(&scope, output_name)?;
 
             match part {
                 FieldBuilderPart::Init {
@@ -174,7 +174,7 @@ impl Compound {
 
         states.push(State::new_with_builder(
             default_state_ident.clone(),
-            &builder_data_ident,
+            builder_data_ident,
             &builder_data_ty,
         ).with_impl(quote! {
             match ev {

xso-proc/src/error_message.rs 🔗

@@ -75,7 +75,7 @@ impl fmt::Display for FieldName<'_> {
 pub(super) fn on_missing_attribute(parent_name: &ParentRef, field: &Member) -> String {
     format!(
         "Required attribute {} on {} missing.",
-        FieldName(&field),
+        FieldName(field),
         parent_name
     )
 }

xso-proc/src/field.rs 🔗

@@ -350,9 +350,6 @@ impl FieldDef {
 
     /// Return true if this field's parsing consumes text data.
     pub(crate) fn is_text_field(&self) -> bool {
-        match self.kind {
-            FieldKind::Text { .. } => true,
-            _ => false,
-        }
+        matches!(self.kind, FieldKind::Text { .. })
     }
 }

xso-proc/src/meta.rs 🔗

@@ -16,9 +16,9 @@ use syn::{meta::ParseNestedMeta, spanned::Spanned, *};
 use rxml_validation::NcName;
 
 /// XML core namespace URI (for the `xml:` prefix)
-pub const XMLNS_XML: &'static str = "http://www.w3.org/XML/1998/namespace";
+pub const XMLNS_XML: &str = "http://www.w3.org/XML/1998/namespace";
 /// XML namespace URI (for the `xmlns:` prefix)
-pub const XMLNS_XMLNS: &'static str = "http://www.w3.org/2000/xmlns/";
+pub const XMLNS_XMLNS: &str = "http://www.w3.org/2000/xmlns/";
 
 /// Value for the `#[xml(namespace = ..)]` attribute.
 #[derive(Debug)]

xso-proc/src/structs.rs 🔗

@@ -118,7 +118,7 @@ impl StructDef {
             .compile()
             .render(
                 vis,
-                &builder_ty_ident,
+                builder_ty_ident,
                 &state_ty_ident,
                 &TypePath {
                     qself: None,
@@ -165,7 +165,7 @@ impl StructDef {
                 }
                 .into(),
                 &state_ty_ident,
-                &event_iter_ty_ident,
+                event_iter_ty_ident,
             )?;
 
         Ok(IntoXmlParts {