From 81566e2ea23401e85bea01b8613ae3f4a89c3f70 Mon Sep 17 00:00:00 2001 From: Callum Cunha <callum.cunha@gmail.com> Date: Fri, 22 Mar 2024 14:50:10 +0000 Subject: [PATCH] fix: named enum try_from impl --- src/logic/args.rs | 2 +- src/view.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/logic/args.rs b/src/logic/args.rs index b5ea74d..244a4e2 100644 --- a/src/logic/args.rs +++ b/src/logic/args.rs @@ -232,7 +232,7 @@ impl FieldsArg { (Fields(f), Fields(ref b)) => f .into_iter() .filter(|v| !b.contains(v)) - .chain(b.clone().into_iter()) + .chain(b.clone()) .collect(), (Fields(f), Omit(b)) => f.into_iter().filter(|v| !b.contains(v)).collect(), (Omit(f), Fields(b)) => b.into_iter().filter(|v| !f.contains(v)).collect(), diff --git a/src/view.rs b/src/view.rs index 6f56944..64fa07b 100644 --- a/src/view.rs +++ b/src/view.rs @@ -199,7 +199,7 @@ fn impl_for_enum(data: &DataEnum, field_mapping: &mut Vec<TokenStream>, field_ma #name::#field_name{#(#variant_args),*} => #original_name::#field_name{#(#variant_args),*} }); field_mapping_reverse.push(quote!{ - #original_name::#field_name(#(#variant_args),*) => #name::#field_name(#(#variant_args),*) + #original_name::#field_name{#(#variant_args),*} => #name::#field_name{#(#variant_args),*} }); }, };