From 9ac2245970de90af30bff9d1f7f35cd2d8f2bf6d Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Mon, 11 Apr 2022 13:15:00 -0500 Subject: [PATCH] remove clone (#24244) --- runtime/src/accounts_background_service.rs | 2 +- runtime/src/bank.rs | 4 ++-- runtime/src/snapshot_package.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/src/accounts_background_service.rs b/runtime/src/accounts_background_service.rs index 4b339a0fb8..6a863218f6 100644 --- a/runtime/src/accounts_background_service.rs +++ b/runtime/src/accounts_background_service.rs @@ -158,7 +158,7 @@ impl SnapshotRequestHandler { ancestors: None, use_write_cache: false, epoch_schedule: snapshot_root_bank.epoch_schedule(), - rent_collector: &snapshot_root_bank.rent_collector(), + rent_collector: snapshot_root_bank.rent_collector(), }, ).unwrap(); assert_eq!(previous_hash, this_hash); diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 8164f8bfe9..2884fda514 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -6155,8 +6155,8 @@ impl Bank { *self.inflation.read().unwrap() } - pub fn rent_collector(&self) -> RentCollector { - self.rent_collector.clone() + pub fn rent_collector(&self) -> &RentCollector { + &self.rent_collector } /// Return the total capitalization of the Bank diff --git a/runtime/src/snapshot_package.rs b/runtime/src/snapshot_package.rs index 95f5aacb4e..87bf2038b6 100644 --- a/runtime/src/snapshot_package.rs +++ b/runtime/src/snapshot_package.rs @@ -112,7 +112,7 @@ impl AccountsPackage { snapshot_type, accounts: bank.accounts(), epoch_schedule: *bank.epoch_schedule(), - rent_collector: bank.rent_collector(), + rent_collector: bank.rent_collector().clone(), }) } }