瀏覽代碼

cargo fmt

Ian Goldberg 6 月之前
父節點
當前提交
bed5f08d4a
共有 1 個文件被更改,包括 13 次插入7 次删除
  1. 13 7
      cmzcred_derive/src/lib.rs

+ 13 - 7
cmzcred_derive/src/lib.rs

@@ -11,17 +11,24 @@ the CMZCredential trait for the declared credential.
 
 */
 
+use darling::FromDeriveInput;
 use proc_macro::TokenStream;
 use quote::quote;
-use syn::{Data,DataStruct,DeriveInput,Fields,FieldsNamed,Ident,Visibility};
-use darling::FromDeriveInput;
+use syn::{Data, DataStruct, DeriveInput, Fields, FieldsNamed, Ident, Visibility};
 
 fn impl_cmzcred_derive(ast: &syn::DeriveInput, group_ident: &Ident) -> TokenStream {
     // Ensure that CMZCred is derived on a struct and not something else
     // (like an enum)
-    let Data::Struct(DataStruct{struct_token: _,
-        fields: Fields::Named(FieldsNamed{brace_token: _, ref named}),
-        semi_token: _}) = ast.data else {
+    let Data::Struct(DataStruct {
+        struct_token: _,
+        fields:
+            Fields::Named(FieldsNamed {
+                brace_token: _,
+                ref named,
+            }),
+        semi_token: _,
+    }) = ast.data
+    else {
         panic!("CMZCred derived on a non-struct");
     };
     // attrs and idents are each vectors of the names of the attributes
@@ -44,8 +51,7 @@ fn impl_cmzcred_derive(ast: &syn::DeriveInput, group_ident: &Ident) -> TokenStre
     }
     let num_attrs = attrs.len();
     let name = &ast.ident;
-    let errmsg = format!("Invalid attribute name for {} CMZ credential",
-        name);
+    let errmsg = format!("Invalid attribute name for {} CMZ credential", name);
 
     // Output the CMZCredential trait implementation
     let gen = quote! {