diff --git a/core/src/cluster_info.rs b/core/src/cluster_info.rs index f100093d661606..22ed1ca03f9951 100644 --- a/core/src/cluster_info.rs +++ b/core/src/cluster_info.rs @@ -2425,8 +2425,7 @@ mod tests { fn test_crds_values(pubkey: Pubkey) -> Vec { let entrypoint = ContactInfo::new_localhost(&pubkey, timestamp()); - let entrypoint_crdsvalue = - CrdsValue::new_unsigned(CrdsData::ContactInfo(entrypoint.clone())); + let entrypoint_crdsvalue = CrdsValue::new_unsigned(CrdsData::ContactInfo(entrypoint)); vec![entrypoint_crdsvalue] } diff --git a/core/src/rpc_pubsub.rs b/core/src/rpc_pubsub.rs index 07917bbe88a488..8abf266e3849f2 100644 --- a/core/src/rpc_pubsub.rs +++ b/core/src/rpc_pubsub.rs @@ -921,8 +921,8 @@ mod tests { }); // Process votes and check they were notified. - // FIXME - clone belwow is required for testcase to pass - #[allow(clippy::redundant_clone)] + // FIXME - clone belwow is required for testcase to pass + #[allow(clippy::redundant_clone)] ClusterInfoVoteListener::get_and_process_votes_for_tests( &votes_receiver, &vote_tracker, diff --git a/sdk/src/slot_history.rs b/sdk/src/slot_history.rs index 3fa97392b0f31e..bdee200a4576b5 100644 --- a/sdk/src/slot_history.rs +++ b/sdk/src/slot_history.rs @@ -99,9 +99,9 @@ mod tests { slot_history.add(MAX_ENTRIES); assert_eq!(slot_history.check(0), Check::TooOld); assert_eq!(slot_history.check(1), Check::NotFound); - assert_eq!(slot_history.check(2), Check::Found); - assert_eq!(slot_history.check(20), Check::Found); - assert_eq!(slot_history.check(MAX_ENTRIES), Check::Found); + for i in &[2, 20, MAX_ENTRIES] { + assert_eq!(slot_history.check(*i), Check::Found); + } for i in 3..20 { assert_eq!(slot_history.check(i), Check::NotFound, "i: {}", i); } @@ -113,12 +113,9 @@ mod tests { info!("add max_entries + 3"); let slot = 3 * MAX_ENTRIES + 3; slot_history.add(slot); - assert_eq!(slot_history.check(0), Check::TooOld); - assert_eq!(slot_history.check(1), Check::TooOld); - assert_eq!(slot_history.check(2), Check::TooOld); - assert_eq!(slot_history.check(20), Check::TooOld); - assert_eq!(slot_history.check(21), Check::TooOld); - assert_eq!(slot_history.check(MAX_ENTRIES), Check::TooOld); + for i in &[0, 1, 2, 20, 21, MAX_ENTRIES] { + assert_eq!(slot_history.check(*i), Check::TooOld); + } let start = slot - MAX_ENTRIES + 1; let end = slot; for i in start..end {