From d5ab521707476c1b5f994a7f1b422754d4c42bf8 Mon Sep 17 00:00:00 2001 From: Paho Lurie-Gregg Date: Mon, 13 Feb 2023 15:41:07 -0800 Subject: [PATCH] Run cargo fmt (#1) --- src/lib.rs | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e0ae09a..88bf1b6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -51,16 +51,12 @@ fn variant_to_unary_pat(variant: &Variant) -> TokenStream2 { match &variant.fields { syn::Fields::Named(named) => { - let vars: Punctuated = - named.named.iter().map(snake_case).collect(); + let vars: Punctuated = named.named.iter().map(snake_case).collect(); quote!(#ident{#vars}) } syn::Fields::Unnamed(unnamed) => { - let vars: Punctuated = unnamed - .unnamed - .iter() - .map(snake_case) - .collect(); + let vars: Punctuated = + unnamed.unnamed.iter().map(snake_case).collect(); quote!(#ident(#vars)) } syn::Fields::Unit => quote!(#ident), @@ -77,8 +73,7 @@ fn partial_eq_arm(variant: &Variant, child_ident: &Ident, parent_ident: &Ident) match &variant.fields { syn::Fields::Named(named) => { - let vars1: Punctuated = - named.named.iter().map(snake_case).collect(); + let vars1: Punctuated = named.named.iter().map(snake_case).collect(); let vars2: Punctuated = vars1.iter().map(|v| format_ident!("{}2", v)).collect(); let vars_rhs: Punctuated = vars1 @@ -96,11 +91,8 @@ fn partial_eq_arm(variant: &Variant, child_ident: &Ident, parent_ident: &Ident) quote!((#child_ident::#ident{#vars1}, #parent_ident::#ident{#vars2}) => #vars_rhs) } syn::Fields::Unnamed(unnamed) => { - let vars1: Punctuated = unnamed - .unnamed - .iter() - .map(snake_case) - .collect(); + let vars1: Punctuated = + unnamed.unnamed.iter().map(snake_case).collect(); let vars2: Punctuated = vars1.iter().map(|v| format_ident!("{}2", v)).collect(); let vars_rhs: Punctuated = vars1 @@ -305,10 +297,7 @@ pub fn subenum(_attr: TokenStream, tokens: TokenStream) -> TokenStream { } } - let enums: Vec<_> = enums - .into_values() - .map(|e| e.build(&input, data)) - .collect(); + let enums: Vec<_> = enums.into_values().map(|e| e.build(&input, data)).collect(); sanitize_input(&mut input);