Skip to content

Commit abe04a7

Browse files
committed
fix new clippy introduced with 1.65
1 parent cdf0958 commit abe04a7

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

actors/miner/src/testing.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ pub fn check_deadline_state_invariants<BS: Blockstore>(
836836
);
837837

838838
summary.expiration_epochs.iter().for_each(|&epoch| {
839-
partitions_with_expirations.entry(epoch).or_insert(Vec::new()).push(index);
839+
partitions_with_expirations.entry(epoch).or_default().push(index);
840840
});
841841

842842
if summary.early_termination_count > 0 {

actors/power/src/state.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ impl State {
238238
pub(super) fn update_smoothed_estimate(&mut self, delta: ChainEpoch) {
239239
let filter_qa_power = AlphaBetaFilter::load(
240240
&self.this_epoch_qa_power_smoothed,
241-
&*DEFAULT_ALPHA,
242-
&*DEFAULT_BETA,
241+
&DEFAULT_ALPHA,
242+
&DEFAULT_BETA,
243243
);
244244
self.this_epoch_qa_power_smoothed =
245245
filter_qa_power.next_estimate(&self.this_epoch_quality_adj_power, delta);

actors/power/src/testing.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ fn check_cron_invariants<BS: Blockstore>(
126126
);
127127
events
128128
.for_each(|_, event| {
129-
cron_events_by_address.entry(event.miner_addr).or_insert(Vec::new()).push(
129+
cron_events_by_address.entry(event.miner_addr).or_default().push(
130130
MinerCronEvent { epoch, payload: event.callback_payload.clone() },
131131
);
132132
Ok(())

test_vm/src/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,7 @@ impl<'bs> VM<'bs> {
392392

393393
pub fn get_state<C: Cbor>(&self, addr: Address) -> Option<C> {
394394
let a_opt = self.get_actor(addr);
395-
if a_opt == None {
396-
return None;
397-
};
395+
a_opt.as_ref()?;
398396
let a = a_opt.unwrap();
399397
self.store.get_cbor::<C>(&a.head).unwrap()
400398
}

0 commit comments

Comments
 (0)