Skip to content

Commit dda11bb

Browse files
committed
fix clippy
1 parent c549be9 commit dda11bb

10 files changed

Lines changed: 11 additions & 10 deletions

File tree

crates/era-downloader/src/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub fn read_dir(
4343
.collect::<eyre::Result<Vec<_>>>()?;
4444
let mut checksums = checksums.ok_or_eyre("Missing file `checksums.txt` in the `dir`")?;
4545

46-
entries.sort_by(|(left, _), (right, _)| left.cmp(right));
46+
entries.sort_by_key(|(left, _)| *left);
4747

4848
Ok(stream::iter(entries.into_iter().skip(start_from as usize / BLOCKS_PER_FILE).map(
4949
move |(_, path)| {

crates/net/discv4/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1628,7 +1628,7 @@ impl Discv4Service {
16281628
.filter(|entry| entry.node.value.is_expired())
16291629
.map(|n| n.node.value)
16301630
.collect::<Vec<_>>();
1631-
nodes.sort_by(|a, b| a.last_seen.cmp(&b.last_seen));
1631+
nodes.sort_by_key(|a| a.last_seen);
16321632
let to_ping = nodes.into_iter().map(|n| n.record).take(MAX_NODES_PING).collect::<Vec<_>>();
16331633
for node in to_ping {
16341634
self.try_ping(node, PingReason::RePing)

crates/scroll/alloy/evm/src/block/curie.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ mod tests {
151151

152152
// check oracle storage changeset
153153
let mut storage = oracle.storage.into_iter().collect::<Vec<(U256, StorageSlot)>>();
154-
storage.sort_by(|(a, _), (b, _)| a.cmp(b));
154+
storage.sort_by_key(|(a, _)| *a);
155155
for (got, expected) in storage.into_iter().zip(CURIE_L1_GAS_PRICE_ORACLE_STORAGE) {
156156
assert_eq!(got.0, expected.0);
157157
assert_eq!(got.1, StorageSlot { present_value: expected.1, ..Default::default() });

crates/scroll/alloy/evm/src/block/feynman.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ mod tests {
148148

149149
// check oracle storage changeset
150150
let mut storage = oracle.storage.into_iter().collect::<Vec<(U256, StorageSlot)>>();
151-
storage.sort_by(|(a, _), (b, _)| a.cmp(b));
151+
storage.sort_by_key(|(a, _)| *a);
152152
for (got, expected) in storage.into_iter().zip(FEYNMAN_L1_GAS_PRICE_ORACLE_STORAGE) {
153153
assert_eq!(got.0, expected.0);
154154
assert_eq!(got.1, StorageSlot { present_value: expected.1, ..Default::default() });

crates/scroll/alloy/evm/src/block/galileo_v2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ mod tests {
148148

149149
// check oracle storage changeset
150150
let mut storage = oracle.storage.into_iter().collect::<Vec<(U256, StorageSlot)>>();
151-
storage.sort_by(|(a, _), (b, _)| a.cmp(b));
151+
storage.sort_by_key(|(a, _)| *a);
152152
for (got, expected) in storage.into_iter().zip(GALILEO_V2_L1_GAS_PRICE_ORACLE_STORAGE) {
153153
assert_eq!(got.0, expected.0);
154154
assert_eq!(got.1, StorageSlot { present_value: expected.1, ..Default::default() });

crates/scroll/evm/src/execute.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ mod tests {
446446

447447
// check oracle contract contains storage changeset
448448
let mut storage = oracle.storage.into_iter().collect::<Vec<(U256, StorageSlot)>>();
449-
storage.sort_by(|(a, _), (b, _)| a.cmp(b));
449+
storage.sort_by_key(|(a, _)| *a);
450450
for (got, expected) in storage.into_iter().zip(CURIE_L1_GAS_PRICE_ORACLE_STORAGE) {
451451
assert_eq!(got.0, expected.0);
452452
assert_eq!(got.1, StorageSlot { present_value: expected.1, ..Default::default() });

crates/stages/stages/src/stages/hashing_account.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl AccountHashingStage {
9999
// Account State generator
100100
let mut account_cursor =
101101
provider.tx_ref().cursor_write::<tables::PlainAccountState>()?;
102-
accounts.sort_by(|a, b| a.0.cmp(&b.0));
102+
accounts.sort_by_key(|a| a.0);
103103
for (addr, acc) in &accounts {
104104
account_cursor.append(*addr, acc)?;
105105
}

crates/trie/common/src/updates.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl TrieUpdates {
130130
.collect::<Vec<_>>();
131131

132132
account_nodes.extend(self.removed_nodes.drain().map(|path| (path, None)));
133-
account_nodes.sort_unstable_by(|a, b| a.0.cmp(&b.0));
133+
account_nodes.sort_unstable_by_key(|a| a.0);
134134

135135
let storage_tries = self
136136
.storage_tries
@@ -276,7 +276,7 @@ impl StorageTrieUpdates {
276276
.collect::<Vec<_>>();
277277

278278
storage_nodes.extend(self.removed_nodes.into_iter().map(|path| (path, None)));
279-
storage_nodes.sort_unstable_by(|a, b| a.0.cmp(&b.0));
279+
storage_nodes.sort_unstable_by_key(|a| a.0);
280280

281281
StorageTrieUpdatesSorted { is_deleted: self.is_deleted, storage_nodes }
282282
}

crates/trie/trie/src/verify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl<H: HashedCursorFactory + Clone> Iterator for StateRootBranchNodesIter<H> {
141141
// By sorting by the account we ensure that we continue with the partially processed
142142
// trie (the last of the previous run) first. We sort in reverse order because we pop
143143
// off of this Vec.
144-
self.storage_tries.sort_unstable_by(|a, b| b.0.cmp(&a.0));
144+
self.storage_tries.sort_unstable_by_key(|b| std::cmp::Reverse(b.0));
145145

146146
// loop back to the top.
147147
}

deny.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ exceptions = [
6262
# TODO: decide on MPL-2.0 handling
6363
# These dependencies are grandfathered in https://github.com/paradigmxyz/reth/pull/6980
6464
{ allow = ["MPL-2.0"], name = "option-ext" },
65+
{ allow = ["MPL-2.0"], name = "webpki-root-certs" },
6566
]
6667

6768
# Skip the poseidon-bn254, bn254 and zktrie crates for license verification. We should at some point publish a license for them.

0 commit comments

Comments
 (0)