From 09eaef022fe3a878e90dcfa9bd788d27f9ff4251 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Thu, 18 Jul 2019 13:58:26 +0200 Subject: [PATCH] formatting cleanup Signed-off-by: Wolfgang Bumiller --- proxmox-api-macro/src/api_macro.rs | 22 +++++++++++----------- proxmox-api-macro/src/types.rs | 3 +-- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/proxmox-api-macro/src/api_macro.rs b/proxmox-api-macro/src/api_macro.rs index 388b09ae..615b4ee7 100644 --- a/proxmox-api-macro/src/api_macro.rs +++ b/proxmox-api-macro/src/api_macro.rs @@ -4,9 +4,9 @@ use failure::{bail, format_err, Error}; use quote::{quote, quote_spanned, ToTokens}; use syn::{spanned::Spanned, Expr, Token}; -use crate::util; use crate::api_def::{CommonTypeDefinition, ParameterDefinition}; use crate::parsing::*; +use crate::util; pub fn api_macro(attr: TokenStream, item: TokenStream) -> Result { let definition = attr @@ -415,12 +415,12 @@ fn make_parameter_verifier( Ok(()) } -fn handle_struct( - definition: Object, - item: &syn::ItemStruct, -) -> Result { +fn handle_struct(definition: Object, item: &syn::ItemStruct) -> Result { if item.generics.lt_token.is_some() { - c_bail!(item.generics.span(), "generic types are currently not supported"); + c_bail!( + item.generics.span(), + "generic types are currently not supported" + ); } let name = &item.ident; @@ -573,12 +573,12 @@ fn handle_named_struct_fields( /// /// For enums we automatically implement `ToString`, `FromStr`, and derive `Serialize` and /// `Deserialize` via `serde_plain`. -fn handle_enum( - mut definition: Object, - item: &syn::ItemEnum, -) -> Result { +fn handle_enum(mut definition: Object, item: &syn::ItemEnum) -> Result { if item.generics.lt_token.is_some() { - c_bail!(item.generics.span(), "generic types are currently not supported"); + c_bail!( + item.generics.span(), + "generic types are currently not supported" + ); } let enum_ident = &item.ident; diff --git a/proxmox-api-macro/src/types.rs b/proxmox-api-macro/src/types.rs index c3a69690..2476d2a6 100644 --- a/proxmox-api-macro/src/types.rs +++ b/proxmox-api-macro/src/types.rs @@ -82,9 +82,8 @@ impl AsRef for Name { impl std::hash::Hash for Name { fn hash(&self, state: &mut H) where - H: std::hash::Hasher + H: std::hash::Hasher, { std::hash::Hash::hash::(&self.0, state) } } -