Elides unnecessary lifetimes (#29299)

This commit is contained in:
Brooks 2022-12-20 11:44:17 -06:00 committed by GitHub
parent 65ff61cfc8
commit 053775ad77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 19 additions and 19 deletions

View File

@ -100,7 +100,7 @@ impl Default for Config {
}
/// Defines and builds the CLI args for a run of the benchmark
pub fn build_args<'a, 'b>(version: &'b str) -> App<'a, 'b> {
pub fn build_args<'a>(version: &'_ str) -> App<'a, '_> {
App::new(crate_name!()).about(crate_description!())
.version(version)
.arg({

View File

@ -339,11 +339,11 @@ impl UnprocessedTransactionStorage {
/// of the unprocessed packets that are eligible for retry. A return value of None means that
/// all packets are unprocessed and eligible for retry.
#[must_use]
pub fn process_packets<'a, F>(
pub fn process_packets<F>(
&mut self,
bank: Arc<Bank>,
banking_stage_stats: &BankingStageStats,
slot_metrics_tracker: &'a mut LeaderSlotMetricsTracker,
slot_metrics_tracker: &mut LeaderSlotMetricsTracker,
processing_function: F,
) -> bool
where
@ -430,11 +430,11 @@ impl VoteStorage {
}
// returns `true` if the end of slot is reached
fn process_packets<'a, F>(
fn process_packets<F>(
&mut self,
bank: Arc<Bank>,
banking_stage_stats: &BankingStageStats,
slot_metrics_tracker: &'a mut LeaderSlotMetricsTracker,
slot_metrics_tracker: &mut LeaderSlotMetricsTracker,
mut processing_function: F,
) -> bool
where
@ -852,11 +852,11 @@ impl ThreadLocalUnprocessedPackets {
}
// returns `true` if reached end of slot
fn process_packets<'a, F>(
fn process_packets<F>(
&mut self,
bank: &Bank,
banking_stage_stats: &BankingStageStats,
slot_metrics_tracker: &'a mut LeaderSlotMetricsTracker,
slot_metrics_tracker: &mut LeaderSlotMetricsTracker,
mut processing_function: F,
) -> bool
where

View File

@ -257,7 +257,7 @@ pub fn download_genesis_if_missing(
/// Download a snapshot archive from `rpc_addr`. Use `snapshot_type` to specify downloading either
/// a full snapshot or an incremental snapshot.
pub fn download_snapshot_archive<'a, 'b>(
pub fn download_snapshot_archive(
rpc_addr: &SocketAddr,
full_snapshot_archives_dir: &Path,
incremental_snapshot_archives_dir: &Path,
@ -266,7 +266,7 @@ pub fn download_snapshot_archive<'a, 'b>(
maximum_full_snapshot_archives_to_retain: usize,
maximum_incremental_snapshot_archives_to_retain: usize,
use_progress_bar: bool,
progress_notify_callback: &'a mut DownloadProgressCallbackOption<'b>,
progress_notify_callback: &mut DownloadProgressCallbackOption<'_>,
) -> Result<(), String> {
snapshot_utils::purge_old_snapshot_archives(
full_snapshot_archives_dir,

View File

@ -927,8 +927,8 @@ impl PohRecorder {
// Filters the return result of PohRecorder::bank_start(), returns the bank
// if it's still processing transactions
pub fn get_working_bank_if_not_expired<'a, 'b>(
bank_start: &'b Option<&'a BankStart>,
pub fn get_working_bank_if_not_expired<'a>(
bank_start: &Option<&'a BankStart>,
) -> Option<&'a Arc<Bank>> {
bank_start
.as_ref()

View File

@ -1409,12 +1409,12 @@ impl Accounts {
}
}
fn prepare_if_nonce_account<'a>(
fn prepare_if_nonce_account(
address: &Pubkey,
account: &mut AccountSharedData,
execution_result: &Result<()>,
is_fee_payer: bool,
maybe_nonce: Option<(&'a NonceFull, bool)>,
maybe_nonce: Option<(&NonceFull, bool)>,
&durable_nonce: &DurableNonce,
lamports_per_signature: u64,
) -> bool {

View File

@ -8657,9 +8657,9 @@ impl AccountsDb {
})
}
fn generate_index_for_slot<'a>(
fn generate_index_for_slot(
&self,
accounts_map: GenerateIndexAccountsMap<'a>,
accounts_map: GenerateIndexAccountsMap<'_>,
slot: &Slot,
rent_collector: &RentCollector,
) -> SlotIndexGenerationInfo {

View File

@ -1694,8 +1694,8 @@ impl<T: IndexValue> AccountsIndex<T> {
})
}
fn purge_secondary_indexes_by_inner_key<'a>(
&'a self,
fn purge_secondary_indexes_by_inner_key(
&self,
inner_key: &Pubkey,
account_indexes: &AccountSecondaryIndexes,
) {

View File

@ -153,8 +153,8 @@ pub fn ledger_lockfile(ledger_path: &Path) -> RwLock<File> {
)
}
pub fn lock_ledger<'path, 'lock>(
ledger_path: &'path Path,
pub fn lock_ledger<'lock>(
ledger_path: &Path,
ledger_lockfile: &'lock mut RwLock<File>,
) -> RwLockWriteGuard<'lock, File> {
ledger_lockfile.try_write().unwrap_or_else(|_| {