Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy warnings #3244

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading