Skip to content

Commit 55588f7

Browse files
authored
Rust 1.91 lints (#8340)
Co-Authored-By: Eitan Seri- Levi <[email protected]>
1 parent 5978b4a commit 55588f7

File tree

5 files changed

+7
-12
lines changed

5 files changed

+7
-12
lines changed

beacon_node/beacon_chain/src/attestation_verification.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,7 @@ pub fn verify_signed_aggregate_signatures<T: BeaconChainTypes>(
13441344
.spec
13451345
.fork_at_epoch(indexed_attestation.data().target.epoch);
13461346

1347-
let signature_sets = vec![
1347+
let signature_sets = [
13481348
signed_aggregate_selection_proof_signature_set(
13491349
|validator_index| pubkey_cache.get(validator_index).map(Cow::Borrowed),
13501350
signed_aggregate,

beacon_node/beacon_chain/src/sync_committee_verification.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ pub fn verify_signed_aggregate_signatures<T: BeaconChainTypes>(
628628
(signed_aggregate.message.contribution.slot + 1).epoch(T::EthSpec::slots_per_epoch());
629629
let fork = chain.spec.fork_at_epoch(next_slot_epoch);
630630

631-
let signature_sets = vec![
631+
let signature_sets = [
632632
signed_sync_aggregate_selection_proof_signature_set(
633633
|validator_index| pubkey_cache.get(validator_index).map(Cow::Borrowed),
634634
signed_aggregate,

common/eth2/src/types.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,20 +1560,15 @@ pub struct ForkChoiceNode {
15601560
pub execution_block_hash: Option<Hash256>,
15611561
}
15621562

1563-
#[derive(Copy, Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
1563+
#[derive(Copy, Clone, Debug, Default, Serialize, Deserialize, PartialEq, Eq)]
15641564
#[serde(rename_all = "snake_case")]
15651565
pub enum BroadcastValidation {
1566+
#[default]
15661567
Gossip,
15671568
Consensus,
15681569
ConsensusAndEquivocation,
15691570
}
15701571

1571-
impl Default for BroadcastValidation {
1572-
fn default() -> Self {
1573-
Self::Gossip
1574-
}
1575-
}
1576-
15771572
impl Display for BroadcastValidation {
15781573
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
15791574
match self {

validator_client/http_api/src/tests/keystores.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2091,7 +2091,7 @@ async fn import_remotekey_web3signer_disabled() {
20912091
// Import web3signers.
20922092
tester
20932093
.client
2094-
.post_lighthouse_validators_web3signer(&vec![web3signer_req])
2094+
.post_lighthouse_validators_web3signer(&[web3signer_req])
20952095
.await
20962096
.unwrap();
20972097

@@ -2146,7 +2146,7 @@ async fn import_remotekey_web3signer_enabled() {
21462146
// Import web3signers.
21472147
tester
21482148
.client
2149-
.post_lighthouse_validators_web3signer(&vec![web3signer_req.clone()])
2149+
.post_lighthouse_validators_web3signer(&[web3signer_req.clone()])
21502150
.await
21512151
.unwrap();
21522152

validator_client/initialized_validators/src/key_cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ mod tests {
291291
#[tokio::test]
292292
async fn test_encryption() {
293293
let mut key_cache = KeyCache::new();
294-
let keypairs = vec![Keypair::random(), Keypair::random()];
294+
let keypairs = [Keypair::random(), Keypair::random()];
295295
let uuids = vec![Uuid::from_u128(1), Uuid::from_u128(2)];
296296
let passwords = vec![
297297
PlainText::from(vec![1, 2, 3, 4, 5, 6]),

0 commit comments

Comments
 (0)