Skip to content

Commit

Permalink
Uses next_back() (solana-labs#32478)
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo authored and pull[bot] committed Nov 8, 2023
1 parent 1bfb6aa commit 55ed51d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cli-output/src/cli_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ fn show_votes_and_credits(
}

// Existence of this should guarantee the occurrence of vote truncation
let newest_history_entry = epoch_voting_history.iter().rev().next();
let newest_history_entry = epoch_voting_history.iter().next_back();

writeln!(
f,
Expand Down
6 changes: 3 additions & 3 deletions runtime/src/snapshot_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ fn do_get_highest_bank_snapshot(
mut bank_snapshots: Vec<BankSnapshotInfo>,
) -> Option<BankSnapshotInfo> {
bank_snapshots.sort_unstable();
bank_snapshots.into_iter().rev().next()
bank_snapshots.into_iter().next_back()
}

pub fn serialize_snapshot_data_file<F>(data_file_path: &Path, serializer: F) -> Result<u64>
Expand Down Expand Up @@ -2285,7 +2285,7 @@ pub fn get_highest_full_snapshot_archive_info(
) -> Option<FullSnapshotArchiveInfo> {
let mut full_snapshot_archives = get_full_snapshot_archives(full_snapshot_archives_dir);
full_snapshot_archives.sort_unstable();
full_snapshot_archives.into_iter().rev().next()
full_snapshot_archives.into_iter().next_back()
}

/// Get the path for the incremental snapshot archive with the highest slot, for a given full
Expand All @@ -2305,7 +2305,7 @@ pub fn get_highest_incremental_snapshot_archive_info(
})
.collect::<Vec<_>>();
incremental_snapshot_archives.sort_unstable();
incremental_snapshot_archives.into_iter().rev().next()
incremental_snapshot_archives.into_iter().next_back()
}

pub fn purge_old_snapshot_archives(
Expand Down

0 comments on commit 55ed51d

Please sign in to comment.