From 2851aa8e3ad8cd16931f805f20a4a6268fba7813 Mon Sep 17 00:00:00 2001 From: bokuweb Date: Thu, 6 Apr 2023 14:20:42 +0900 Subject: [PATCH] Revert "Remove unnecessary clone (#213)" (#219) This reverts commit 35950f5b4fc545b84ddc0d8def6e8b88b7bd0b56. --- raiden-derive/src/ops/transact_write.rs | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/raiden-derive/src/ops/transact_write.rs b/raiden-derive/src/ops/transact_write.rs index 9cd5bcde..4eeb320d 100644 --- a/raiden-derive/src/ops/transact_write.rs +++ b/raiden-derive/src/ops/transact_write.rs @@ -37,25 +37,6 @@ pub(crate) fn expand_transact_write( // } // }); - let mut concatenated = TokenStream::new(); - let iter = fields.named.clone().into_iter(); - let mut i = 0; - for f in iter { - let ident = f.ident.expect("Expected a named field"); - if !crate::finder::include_unary_attr(&f.attrs, "uuid") { - if i == 0 { - concatenated.append_all(quote! {#ident}); - } else { - concatenated.append_all(quote! {, #ident}); - } - i += 1 - } - } - - let bound = quote! { - let #item_input_name { #concatenated } = item; - }; - let input_items = { let insertion = fields.named.iter().map(|f| { let ident = &f.ident.clone().unwrap(); @@ -75,7 +56,7 @@ pub(crate) fn expand_transact_write( } } else { quote! { - let value = #ident.into_attr(); + let value = item.#ident.into_attr(); if !::raiden::is_attr_value_empty(&value) { input_item.insert( #attr_key.to_string(), @@ -87,7 +68,6 @@ pub(crate) fn expand_transact_write( }); quote! { - #bound let mut input_item: std::collections::HashMap = std::collections::HashMap::new(); #(#insertion)* }