Rust 1.84 lints (#6781)

* Fix few lints

* Fix remaining lints

* Use fully qualified syntax
This commit is contained in:
Pawan Dhananjay
2025-01-10 06:43:29 +05:30
committed by GitHub
parent 87b72dec21
commit 1f6850fae2
61 changed files with 110 additions and 138 deletions

View File

@@ -1305,7 +1305,7 @@ impl BannedPeersCount {
pub fn ip_is_banned(&self, ip: &IpAddr) -> bool {
self.banned_peers_per_ip
.get(ip)
.map_or(false, |count| *count > BANNED_PEERS_PER_IP_THRESHOLD)
.is_some_and(|count| *count > BANNED_PEERS_PER_IP_THRESHOLD)
}
}

View File

@@ -99,7 +99,7 @@ impl<E: EthSpec> PeerInfo<E> {
Subnet::SyncCommittee(id) => {
return meta_data
.syncnets()
.map_or(false, |s| s.get(**id as usize).unwrap_or(false))
.is_ok_and(|s| s.get(**id as usize).unwrap_or(false))
}
Subnet::DataColumn(column) => return self.custody_subnets.contains(column),
}
@@ -264,7 +264,7 @@ impl<E: EthSpec> PeerInfo<E> {
/// Reports if this peer has some future validator duty in which case it is valuable to keep it.
pub fn has_future_duty(&self) -> bool {
self.min_ttl.map_or(false, |i| i >= Instant::now())
self.min_ttl.is_some_and(|i| i >= Instant::now())
}
/// Returns score of the peer.