]> git.proxmox.com Git - proxmox.git/commitdiff
formatting cleanup
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 18 Jul 2019 11:58:26 +0000 (13:58 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 18 Jul 2019 11:58:26 +0000 (13:58 +0200)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
proxmox-api-macro/src/api_macro.rs
proxmox-api-macro/src/types.rs

index 388b09aeb121057645e533a10cee30eff5d2bada..615b4ee707af324bbb40acb41e41ff3e49f9cc75 100644 (file)
@@ -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<TokenStream, Error> {
     let definition = attr
@@ -415,12 +415,12 @@ fn make_parameter_verifier(
     Ok(())
 }
 
-fn handle_struct(
-    definition: Object,
-    item: &syn::ItemStruct,
-) -> Result<TokenStream, Error> {
+fn handle_struct(definition: Object, item: &syn::ItemStruct) -> Result<TokenStream, Error> {
     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<TokenStream, Error> {
+fn handle_enum(mut definition: Object, item: &syn::ItemEnum) -> Result<TokenStream, Error> {
     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;
index c3a696900a9b06aaf86f1a55d1ecbc9ff9ab6fe7..2476d2a62a0bc6461ecc7b861c0c17d2d4ab87ba 100644 (file)
@@ -82,9 +82,8 @@ impl AsRef<str> for Name {
 impl std::hash::Hash for Name {
     fn hash<H>(&self, state: &mut H)
     where
-        H: std::hash::Hasher
+        H: std::hash::Hasher,
     {
         std::hash::Hash::hash::<H>(&self.0, state)
     }
 }
-