Skip to content

Commit

Permalink
refactor: Avoid .clone()
Browse files Browse the repository at this point in the history
  • Loading branch information
morgsmccauley committed Dec 21, 2023
1 parent ac305f1 commit c971512
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions coordinator/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,16 @@ impl RegistryImpl {
registry: HashMap<AccountId, HashMap<String, registry_types::IndexerConfig>>,
) -> 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,
Expand All @@ -71,7 +70,7 @@ impl RegistryImpl {
})
.collect::<HashMap<_, _>>();

(account_id.clone(), indexers)
(account_id, indexers)
})
.collect::<HashMap<_, _>>()
}
Expand Down

0 comments on commit c971512

Please sign in to comment.