From 3c825f28a5a5bb067a2f7ee23e75dc09b2c74d41 Mon Sep 17 00:00:00 2001 From: Brooks Date: Thu, 13 Jul 2023 13:38:18 -0400 Subject: [PATCH] Uses next_back() (#32478) --- cli-output/src/cli_output.rs | 2 +- runtime/src/snapshot_utils.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cli-output/src/cli_output.rs b/cli-output/src/cli_output.rs index 83b7babf0..a0fd2727e 100644 --- a/cli-output/src/cli_output.rs +++ b/cli-output/src/cli_output.rs @@ -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, diff --git a/runtime/src/snapshot_utils.rs b/runtime/src/snapshot_utils.rs index 0a83d60a1..761fb9553 100644 --- a/runtime/src/snapshot_utils.rs +++ b/runtime/src/snapshot_utils.rs @@ -919,7 +919,7 @@ fn do_get_highest_bank_snapshot( mut bank_snapshots: Vec, ) -> Option { bank_snapshots.sort_unstable(); - bank_snapshots.into_iter().rev().next() + bank_snapshots.into_iter().next_back() } pub fn serialize_snapshot_data_file(data_file_path: &Path, serializer: F) -> Result @@ -2285,7 +2285,7 @@ pub fn get_highest_full_snapshot_archive_info( ) -> Option { 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 @@ -2305,7 +2305,7 @@ pub fn get_highest_incremental_snapshot_archive_info( }) .collect::>(); 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(