Skip to content

Commit

Permalink
Fix violations of elided_named_lifetimes
Browse files Browse the repository at this point in the history
rust-lang/rust#129207 helps name certain elided lifetimes
  • Loading branch information
ksolana committed Nov 4, 2024
1 parent 59bf0f0 commit cf2f186
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gossip/src/cluster_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ impl ClusterInfo {
&'a self,
label: &'static str,
counter: &'a Counter,
) -> TimedGuard<'a, RwLockReadGuard<Crds>> {
) -> TimedGuard<'a, RwLockReadGuard<'a, Crds>> {
TimedGuard::new(self.gossip.crds.read().unwrap(), label, counter)
}

Expand Down
4 changes: 2 additions & 2 deletions gossip/src/push_active_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl PushActiveSet {
// If true forces gossip push even if the node has pruned the origin.
should_force_push: impl FnMut(&Pubkey) -> bool + 'a,
stakes: &HashMap<Pubkey, u64>,
) -> impl Iterator<Item = &Pubkey> + 'a {
) -> impl Iterator<Item = &'a Pubkey> + 'a {
let stake = stakes.get(pubkey).min(stakes.get(origin));
self.get_entry(stake)
.get_nodes(pubkey, origin, should_force_push)
Expand Down Expand Up @@ -115,7 +115,7 @@ impl PushActiveSetEntry {
origin: &'a Pubkey, // CRDS value owner.
// If true forces gossip push even if the node has pruned the origin.
mut should_force_push: impl FnMut(&Pubkey) -> bool + 'a,
) -> impl Iterator<Item = &Pubkey> + 'a {
) -> impl Iterator<Item = &'a Pubkey> + 'a {
let pubkey_eq_origin = pubkey == origin;
self.0
.iter()
Expand Down
Empty file added ledger/ledger.lock
Empty file.
4 changes: 2 additions & 2 deletions ledger/src/blockstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ impl Blockstore {
&'a self,
erasure_set: ErasureSetId,
erasure_metas: &'a BTreeMap<ErasureSetId, WorkingEntry<ErasureMeta>>,
) -> Result<Option<(ErasureSetId, Cow<ErasureMeta>)>> {
) -> Result<Option<(ErasureSetId, Cow<'a, ErasureMeta>)>> {
let (slot, fec_set_index) = erasure_set.store_key();

// Check the previous entry from the in memory map to see if it is the consecutive
Expand Down Expand Up @@ -1534,7 +1534,7 @@ impl Blockstore {
slot: Slot,
erasure_meta: &ErasureMeta,
just_received_shreds: &'a HashMap<ShredId, Shred>,
) -> Option<Cow<Vec<u8>>> {
) -> Option<Cow<'a, Vec<u8>>> {
// Search for the shred which set the initial erasure config, either inserted,
// or in the current batch in just_received_shreds.
let index = erasure_meta.first_received_coding_shred_index()?;
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3499,7 +3499,7 @@ impl Bank {
pub fn prepare_unlocked_batch_from_single_tx<'a>(
&'a self,
transaction: &'a SanitizedTransaction,
) -> TransactionBatch<'_, '_, SanitizedTransaction> {
) -> TransactionBatch<'a, 'a, SanitizedTransaction> {
let tx_account_lock_limit = self.get_transaction_account_lock_limit();
let lock_result =
validate_account_locks(transaction.message().account_keys(), tx_account_lock_limit);
Expand Down
2 changes: 1 addition & 1 deletion svm/examples/json-rpc/server/src/rpc_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ impl JsonRpcRequestProcessor {
fn prepare_unlocked_batch_from_single_tx<'a>(
&'a self,
transaction: &'a SanitizedTransaction,
) -> TransactionBatch<'_> {
) -> TransactionBatch<'a> {
let tx_account_lock_limit = solana_sdk::transaction::MAX_TX_ACCOUNT_LOCKS;
let lock_result = transaction
.get_account_locks(tx_account_lock_limit)
Expand Down

0 comments on commit cf2f186

Please sign in to comment.