Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
Fix clippy warnings that arose after updating to rust 1.84.0.
  • Loading branch information
jsdanielh committed Jan 16, 2025
1 parent ea1e82a commit b6234f8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion consensus/src/sync/light/validity_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ impl<TNetwork: Network> LightMacroSync<TNetwork> {
// Verify the history chunk
let valid_chunk = chunk
.verify(&expected_root, leaf_index as usize)
.map_or(false, |result| result);
.is_some_and(|result| result);

if !valid_chunk {
// If the chunk doesn't verify we disconnect from the peer
Expand Down
2 changes: 1 addition & 1 deletion consensus/src/sync/live/block_queue/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ impl<N: Network> BlockQueue<N> {
if self
.buffer
.get(&block_number)
.map_or(false, |blocks| blocks.contains_key(&block_hash))
.is_some_and(|blocks| blocks.contains_key(&block_hash))
{
// Block is already buffered and will be pushed sometime soon. No need to request it.
return;
Expand Down
2 changes: 1 addition & 1 deletion mnemonic/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl Entropy {

const WORDLIST_SIZE: usize = 2048;
pub type Wordlist<'a> = [&'a str; WORDLIST_SIZE];
pub const WORDLIST_EN: Wordlist<'static> = [
pub static WORDLIST_EN: Wordlist<'static> = [
"abandon", "ability", "able", "about", "above", "absent", "absorb", "abstract", "absurd",
"abuse", "access", "accident", "account", "accuse", "achieve", "acid", "acoustic", "acquire",
"across", "act", "action", "actor", "actress", "actual", "adapt", "add", "addict", "address",
Expand Down
2 changes: 1 addition & 1 deletion network-libp2p/src/discovery/peer_contacts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ impl PeerContactInfo {
pub fn exceeds_age(&self, max_age: Duration, unix_time: Duration) -> bool {
unix_time
.checked_sub(Duration::from_secs(self.contact.inner.timestamp()))
.map_or(false, |age| age > max_age)
.is_some_and(|age| age > max_age)
}

/// Returns true if the services provided are interesting to me
Expand Down
2 changes: 1 addition & 1 deletion primitives/account/src/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ impl Accounts {
let missing = self
.tree
.get_missing_range(txn)
.map_or(false, |range| range.contains(&rightmost_key));
.is_some_and(|range| range.contains(&rightmost_key));

if missing {
self.tree
Expand Down

0 comments on commit b6234f8

Please sign in to comment.