From db1003b5f84053914f76f893f62d31249e0d9930 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sun, 21 Jun 2020 08:36:07 +0000 Subject: [PATCH] nit removal (#10721) (#10729) (cherry picked from commit a87f490b5e066ccdbba7eadf2925796f210f06e5) Co-authored-by: Kristofer Peterson --- core/tests/bank_forks.rs | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/core/tests/bank_forks.rs b/core/tests/bank_forks.rs index 9cc8e66d63..5b55ebb94c 100644 --- a/core/tests/bank_forks.rs +++ b/core/tests/bank_forks.rs @@ -315,7 +315,7 @@ mod tests { if slot == saved_slot as u64 { let options = CopyOptions::new(); fs_extra::dir::copy(accounts_dir, &saved_accounts_dir, &options).unwrap(); - let snapshot_paths = fs::read_dir(snapshot_path) + let last_snapshot_path = fs::read_dir(snapshot_path) .unwrap() .filter_map(|entry| { let e = entry.unwrap(); @@ -330,7 +330,7 @@ mod tests { .last() .unwrap(); // only save off the snapshot of this slot, we don't need the others. - fs_extra::dir::copy(&snapshot_paths, &saved_snapshots_dir, &options).unwrap(); + fs_extra::dir::copy(&last_snapshot_path, &saved_snapshots_dir, &options).unwrap(); saved_archive_path = Some(snapshot_utils::get_snapshot_archive_path( snapshot_package_output_path, @@ -343,13 +343,10 @@ mod tests { // Purge all the outdated snapshots, including the ones needed to generate the package // currently sitting in the channel bank_forks.purge_old_snapshots(); - assert_eq!( - snapshot_utils::get_snapshot_paths(&snapshots_dir) - .into_iter() - .map(|path| path.slot) - .eq(3..=MAX_CACHE_ENTRIES as u64 + 2), - true - ); + assert!(snapshot_utils::get_snapshot_paths(&snapshots_dir) + .into_iter() + .map(|path| path.slot) + .eq(3..=MAX_CACHE_ENTRIES as u64 + 2)); // Create a SnapshotPackagerService to create tarballs from all the pending // SnapshotPackage's on the channel. By the time this service starts, we have already @@ -437,10 +434,7 @@ mod tests { .unwrap() .src .roots(); - assert_eq!( - slots_to_snapshot.into_iter().eq(expected_slots_to_snapshot), - true - ); + assert!(slots_to_snapshot.into_iter().eq(expected_slots_to_snapshot)); } }