From 1d141568323be29fa9520ee91e9551880c6bb384 Mon Sep 17 00:00:00 2001 From: Brooks Date: Wed, 19 Apr 2023 11:09:49 -0400 Subject: [PATCH] Use Arc instead of &Arc in SnapshotPackagerService::new (#31270) --- core/src/snapshot_packager_service.rs | 6 ++---- core/src/validator.rs | 4 ++-- core/tests/epoch_accounts_hash.rs | 4 ++-- core/tests/snapshots.rs | 8 ++++---- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/core/src/snapshot_packager_service.rs b/core/src/snapshot_packager_service.rs index b30fa772b8..c8b5f6c55a 100644 --- a/core/src/snapshot_packager_service.rs +++ b/core/src/snapshot_packager_service.rs @@ -34,13 +34,11 @@ impl SnapshotPackagerService { snapshot_package_sender: Sender, snapshot_package_receiver: Receiver, starting_snapshot_hashes: Option, - exit: &Arc, - cluster_info: &Arc, + exit: Arc, + cluster_info: Arc, snapshot_config: SnapshotConfig, enable_gossip_push: bool, ) -> Self { - let exit = exit.clone(); - let cluster_info = cluster_info.clone(); let max_full_snapshot_hashes = std::cmp::min( MAX_LEGACY_SNAPSHOT_HASHES, snapshot_config diff --git a/core/src/validator.rs b/core/src/validator.rs index fd5531c9a8..1ecc2e49ab 100644 --- a/core/src/validator.rs +++ b/core/src/validator.rs @@ -693,8 +693,8 @@ impl Validator { snapshot_package_sender.clone(), snapshot_package_receiver, starting_snapshot_hashes, - &exit, - &cluster_info, + exit.clone(), + cluster_info.clone(), config.snapshot_config.clone(), enable_gossip_push, ); diff --git a/core/tests/epoch_accounts_hash.rs b/core/tests/epoch_accounts_hash.rs index 9543195ae6..99b5242601 100755 --- a/core/tests/epoch_accounts_hash.rs +++ b/core/tests/epoch_accounts_hash.rs @@ -184,8 +184,8 @@ impl BackgroundServices { snapshot_package_sender.clone(), snapshot_package_receiver, None, - &exit, - &cluster_info, + exit.clone(), + cluster_info.clone(), snapshot_config.clone(), false, ); diff --git a/core/tests/snapshots.rs b/core/tests/snapshots.rs index 2a0688c7d8..cb45a9810f 100644 --- a/core/tests/snapshots.rs +++ b/core/tests/snapshots.rs @@ -509,8 +509,8 @@ fn test_concurrent_snapshot_packaging( snapshot_package_sender.clone(), snapshot_package_receiver, None, - &exit, - &cluster_info, + exit.clone(), + cluster_info, snapshot_config.clone(), true, ); @@ -991,8 +991,8 @@ fn test_snapshots_with_background_services( snapshot_package_sender.clone(), snapshot_package_receiver, None, - &exit, - &cluster_info, + exit.clone(), + cluster_info.clone(), snapshot_test_config.snapshot_config.clone(), false, );