Apply clippy fixes for future rust upgrade (#30363)

This commit is contained in:
Brooks 2023-02-16 11:12:51 -05:00 committed by GitHub
parent 86e59657c9
commit febaf36e6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 9 deletions

View File

@ -1584,7 +1584,7 @@ mod tests {
);
let slot = 239847;
let request = RepairProtocol::Orphan { header, slot };
let mut packet = Packet::from_data(None, &request).unwrap();
let mut packet = Packet::from_data(None, request).unwrap();
sign_packet(&mut packet, &my_keypair);
packet
};
@ -1603,7 +1603,7 @@ mod tests {
);
let slot = 239847;
let request = RepairProtocol::Orphan { header, slot };
let mut packet = Packet::from_data(None, &request).unwrap();
let mut packet = Packet::from_data(None, request).unwrap();
sign_packet(&mut packet, &my_keypair);
packet
};
@ -1625,7 +1625,7 @@ mod tests {
);
let slot = 239847;
let request = RepairProtocol::Orphan { header, slot };
let mut packet = Packet::from_data(None, &request).unwrap();
let mut packet = Packet::from_data(None, request).unwrap();
sign_packet(&mut packet, &my_keypair);
packet
};
@ -1645,7 +1645,7 @@ mod tests {
);
let slot = 239847;
let request = RepairProtocol::Orphan { header, slot };
let mut packet = Packet::from_data(None, &request).unwrap();
let mut packet = Packet::from_data(None, request).unwrap();
sign_packet(&mut packet, &other_keypair);
packet
};

View File

@ -277,7 +277,7 @@ impl CrdsGossipPull {
filters.truncate(MAX_NUM_PULL_REQUESTS);
}
// Associate each pull-request filter with a randomly selected peer.
let dist = WeightedIndex::new(&weights).unwrap();
let dist = WeightedIndex::new(weights).unwrap();
let nodes = repeat_with(|| nodes[dist.sample(&mut rng)].clone());
Ok(nodes.zip(filters).into_group_map())
}

View File

@ -604,7 +604,7 @@ pub mod tests {
sample_period_secs,
};
let actual =
serde_json::to_value(&input).expect("Can convert RpcPerfSample into a JSON value");
serde_json::to_value(input).expect("Can convert RpcPerfSample into a JSON value");
let expected = json!({
"slot": slot,
"numTransactions": num_transactions,

View File

@ -434,9 +434,9 @@ impl AccountsDb {
/// finish shrink operation on slots where a new storage was created
/// drop root and storage for all original slots whose contents were combined into other storages
#[allow(dead_code)]
fn finish_combine_ancient_slots_packed_internal<'a>(
fn finish_combine_ancient_slots_packed_internal(
&self,
accounts_to_combine: AccountsToCombine<'a>,
accounts_to_combine: AccountsToCombine<'_>,
mut write_ancient_accounts: WriteAncientAccounts,
metrics: &mut ShrinkStatsSub,
) {

View File

@ -199,7 +199,7 @@ mod target_arch {
.map_err(|_| AltBn128Error::InvalidInputData)?;
let mut result_point_data = [0; ALT_BN128_MULTIPLICATION_OUTPUT_LEN + 1];
let result_point: G1 = p.into_projective().mul(&fr).into();
let result_point: G1 = p.into_projective().mul(fr).into();
<G1 as ToBytes>::write(&result_point, &mut result_point_data[..])
.map_err(|_| AltBn128Error::InvalidInputData)?;
if result_point == G1::zero() {