From c971512848dca660522f42b753db95867f681854 Mon Sep 17 00:00:00 2001 From: Morgan Mccauley Date: Thu, 21 Dec 2023 15:37:34 +1300 Subject: [PATCH] refactor: Avoid `.clone()` --- coordinator/src/registry.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/coordinator/src/registry.rs b/coordinator/src/registry.rs index dd8bf7868..8c5e015e3 100644 --- a/coordinator/src/registry.rs +++ b/coordinator/src/registry.rs @@ -49,17 +49,16 @@ impl RegistryImpl { registry: HashMap>, ) -> IndexerRegistry { registry - .iter() + .into_iter() .map(|(account_id, indexers)| { let indexers = indexers - .iter() + .into_iter() .map(|(function_name, indexer)| { - let indexer = indexer.clone(); ( - function_name.clone(), + function_name.to_owned(), IndexerConfig { account_id: account_id.clone(), - function_name: function_name.clone(), + function_name, code: indexer.code, start_block_height: indexer.start_block_height, schema: indexer.schema, @@ -71,7 +70,7 @@ impl RegistryImpl { }) .collect::>(); - (account_id.clone(), indexers) + (account_id, indexers) }) .collect::>() }