소스 검색

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! {