Skip to content

Commit 16f8550

Browse files
committed
Appease Clippy
1 parent be6ce4c commit 16f8550

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

src/daemon/db_util.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,10 @@ where
325325
let state_output = state_manager
326326
.compute_tipset_state(Arc::new(ts), NO_CALLBACK, VMTrace::NotTraced)
327327
.await?;
328-
for events_root in state_output.events_roots.iter() {
329-
if let Some(cid) = events_root {
330-
println!("Indexing events root @{}: {}", epoch, cid);
328+
for events_root in state_output.events_roots.iter().flatten() {
329+
println!("Indexing events root @{}: {}", epoch, events_root);
331330

332-
state_manager.chain_store().put_index(cid, &tsk)?;
333-
}
331+
state_manager.chain_store().put_index(events_root, &tsk)?;
334332
}
335333
}
336334

src/rpc/methods/eth/filter/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ impl EthEventHandler {
380380
.roots
381381
.into_iter()
382382
.zip(state_events.events)
383-
.filter(|(cid, _)| cid.as_ref() == Some(&events_root))
383+
.filter(|(cid, _)| cid.as_ref() == Some(events_root))
384384
.map(|(_, v)| v);
385385

386386
let mut chain_events = vec![];

src/state_manager/mod.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -529,12 +529,10 @@ where
529529
let state_output = self
530530
.compute_tipset_state(Arc::clone(tipset), NO_CALLBACK, VMTrace::NotTraced)
531531
.await?;
532-
for events_root in state_output.events_roots.iter() {
533-
if let Some(cid) = events_root {
534-
trace!("Indexing events root @{}: {}", tipset.epoch(), cid);
532+
for events_root in state_output.events_roots.iter().flatten() {
533+
trace!("Indexing events root @{}: {}", tipset.epoch(), events_root);
535534

536-
self.chain_store().put_index(cid, key)?;
537-
}
535+
self.chain_store().put_index(events_root, key)?;
538536
}
539537
let ts_state = state_output.into();
540538
trace!("Completed tipset state calculation {:?}", tipset.cids());

src/tool/subcommands/index_cmd.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,10 @@ impl IndexCommands {
9696
let state_output = state_manager
9797
.compute_tipset_state(Arc::new(ts), NO_CALLBACK, VMTrace::NotTraced)
9898
.await?;
99-
for events_root in state_output.events_roots.iter() {
100-
if let Some(cid) = events_root {
101-
println!("Indexing events root @{}: {}", epoch, cid);
99+
for events_root in state_output.events_roots.iter().flatten() {
100+
println!("Indexing events root @{}: {}", epoch, events_root);
102101

103-
chain_store.put_index(cid, &tsk)?;
104-
}
102+
chain_store.put_index(events_root, &tsk)?;
105103
}
106104
}
107105

0 commit comments

Comments
 (0)