diff --git a/proxmox-api-macro/src/api/method.rs b/proxmox-api-macro/src/api/method.rs index 927030f3..f82cc53a 100644 --- a/proxmox-api-macro/src/api/method.rs +++ b/proxmox-api-macro/src/api/method.rs @@ -356,7 +356,7 @@ fn handle_function_signature( // Found an explicit parameter: extract it: ParameterType::Normal(NormalParameter { ty: &pat_type.ty, - entry: &entry, + entry, }) } else if is_api_method_type(&pat_type.ty) { if api_method_param.is_some() { @@ -567,7 +567,7 @@ fn extract_normal_parameter( ) -> Result<(), Error> { let span = name_span; // renamed during refactorization let name_str = syn::LitStr::new(name.as_str(), span); - let arg_name = Ident::new(&format!("input_arg_{}", name.as_ident().to_string()), span); + let arg_name = Ident::new(&format!("input_arg_{}", name.as_ident()), span); let default_value = param.entry.schema.find_schema_property("default"); diff --git a/proxmox-api-macro/src/api/mod.rs b/proxmox-api-macro/src/api/mod.rs index 18ffdac3..bf8eeac5 100644 --- a/proxmox-api-macro/src/api/mod.rs +++ b/proxmox-api-macro/src/api/mod.rs @@ -443,7 +443,7 @@ pub enum OptionType { /// An updater type uses its "base" type's field's updaters to determine whether the field is /// supposed to be an option. - Updater(syn::Type), + Updater(Box), } impl OptionType { @@ -465,7 +465,7 @@ impl From for OptionType { impl From for OptionType { fn from(ty: syn::Type) -> Self { - OptionType::Updater(ty) + OptionType::Updater(Box::new(ty)) } } diff --git a/proxmox-api-macro/src/serde.rs b/proxmox-api-macro/src/serde.rs index 7df2fe7a..d7f55018 100644 --- a/proxmox-api-macro/src/serde.rs +++ b/proxmox-api-macro/src/serde.rs @@ -8,6 +8,7 @@ use std::convert::TryFrom; use crate::util::{AttrArgs, FieldName}; /// Serde name types. +#[allow(clippy::enum_variant_names)] #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum RenameAll { LowerCase, diff --git a/proxmox-api-macro/src/util.rs b/proxmox-api-macro/src/util.rs index 77e0098d..002e3e92 100644 --- a/proxmox-api-macro/src/util.rs +++ b/proxmox-api-macro/src/util.rs @@ -561,7 +561,7 @@ pub fn make_path(span: Span, leading_colon: bool, path: &[&str]) -> syn::Path { None }, segments: path - .into_iter() + .iter() .map(|entry| syn::PathSegment { ident: Ident::new(entry, span), arguments: syn::PathArguments::None, @@ -682,9 +682,9 @@ impl Maybe { } } -impl Into> for Maybe { - fn into(self) -> Option { - match self { +impl From> for Option { + fn from(maybe: Maybe) -> Option { + match maybe { Maybe::Explicit(t) | Maybe::Derived(t) => Some(t), Maybe::None => None, } @@ -694,7 +694,7 @@ impl Into> for Maybe { /// Helper to iterate over all the `#[derive(...)]` types found in an attribute list. pub fn derived_items(attributes: &[syn::Attribute]) -> DerivedItems { DerivedItems { - attributes: attributes.into_iter(), + attributes: attributes.iter(), current: None, } }